AOS Device SDK
|
Download the SDK installer and run it. It will prompt you for an install location.
Here's a complete example of installing the SDK under /opt/tools:
SDK versions 6.9.2 and above provide a aossdkshell
script which will create a development shell, in which the shell environment is set up for using the SDK toolchain. It will change the shell prompt to make it clear to the user that the SDK environment is sourced, meaning it is configured for cross compilation, and SDK tools are in the default PATH. You can exit out of the development shell with the exit
command.
Alternatively, source the environment file as indicated at SDK installation. It will set the environment in the current shell for using the SDK tools and cross compilation.
Run make
to build the app.
Once the app is built, several SDK tools can be used for app testing and packaging:
aosapp
- Install, Uninstall, Activate, and Deactivate the app on a connected development device.aospkg
- Create an unsigned AOS package.aoscsr
- Perform a Certificate Signing Request to create a key/certificate pair for code signing.aossignpkg
- Create a signed AOS package using the certificate/key pair generated by aoscsr
.Connect a device to your host via USB or Wi-Fi. Make sure you have the adb
command installed. On Ubuntu, it is in the android-tools-adb package.
Refer to ADB over Wi-Fi if connecting to the device over Wi-Fi.
Confirm you can open an ADB shell on the device.
Use the aosapp command to install and activate the app. Run aosapp install
to install the app on the connected device. Use the -s <serialno>
option if there are multiple devices connected. If the application installs successfully, it can then be activated with aosapp activate
.
Run aosapp -h
to see the list of options.
Use aosapp to control whether the app is activated on the device, meaning it will run automatically.
aosapp activate
- Enable the app so it is always running.aosapp deactivate
- Disable the app so it does not run.To simply stop, start, or restart an app, use prctl from a device shell.
prctl stop <appname>
- Stop the appprctl start <appname>
- Start the appprctl restart <appname>
- Restart the appprctl status <appname>
- Check the status of the appWhen stopping the app, if it does not exit in response to a SIGTERM sent by the supervisor process, it will be terminated after a few seconds with SIGKILL (9). prctl reports this fact in the status as "(last killed by signal: 9)".
Until further notice, the app can only be updated by first uninstalling it, and then installing the new version.
Use the adb command to access a device, either over USB or Wi-Fi. Running adb shell
will drop you into a shell as the apps user. Common linux commands can be run from this shell.
If multiple devices are attached, use the -s
option to select a device by its serial number. adb devices
will list all the connected devices.
If you specify a command and arguments after adb shell
, adb will run that command in a shell.
Example:
When USB is not available and the development host is connected to a device's Wi-Fi AP, a connection must first be made between the host's adb service the the device's adb service.
Create a connection to the device's adb service:
If successful, the adb devices command will show the attached device:
When finished using adb over wifi, break the connection between host and device:
From a device shell, use the logread or journalctl command to read the system log. Use grep for filtering.
Example:
Running aosapp shell
will open a shell in an environment identically to the one the application runs in.
Example: