forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 4
The easiest way to build Android CHIPTool app
Filip Jagodziński edited this page Mar 25, 2021
·
2 revisions
-
Move to the root of
connectedhomeip
project. -
Run a Docker container with CHIP source dir mounted in
/home/connectedhomeip
. If the image is not available locally, Docker will fetch one for you.-
If you are fine with the container polluting your source dir with build artifacts use:
$ docker run --interactive --tty --rm --volume "$PWD:/home/connectedhomeip" --workdir "/home/connectedhomeip" connectedhomeip/chip-build-android bash
-
If you want to keep your source dir clean, you can mount the volume as
readonly
:$ docker run --privileged --interactive --tty --rm --volume "$PWD:/home/connectedhomeip-ro:ro" connectedhomeip/chip-build-android bash
and then use an overlay:
$ mkdir -p /tmp/overlay /home/connectedhomeip $ mount -t tmpfs tmpfs /tmp/overlay $ mkdir -p /tmp/overlay/{upper,work} $ mount -t overlay overlay -o lowerdir=/home/connectedhomeip-ro,upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work /home/connectedhomeip $ cd /home/connectedhomeip
-
-
Accept all Android SDK licenses.
$ yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses
-
Bootstrap the environment.
$ ./scripts/build/gn_bootstrap.sh
-
Build CHIP libs. You can choose from
arm
,arm64
,x86
orx64
target CPU arch.$ TARGET_CPU="arm64" ./scripts/examples/android_app.sh
-
Build CHIPTool app.
$ pushd src/android/CHIPTool/; ./gradlew build; popd
The apk files (debug and release) are available in src/android/CHIPTool/app/build/outputs/apk/.