Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / android / CHIPTool / README.md
1 # Android CHIPTool
2
3 This directory contains the Android Studio project for CHIPTool, an Android
4 application for commissioning and controlling CHIP accessories.
5
6 CHIPTool offers the following features:
7
8 -   Scan a CHIP QR code and display payload information to the user
9 -   Read the NFC tag containing CHIP onboarding information
10 -   Commission a CHIP device
11 -   Send echo requests to the CHIP echo server
12 -   Send on/off cluster requests to a CHIP device
13
14 > :warning: Connection to the CHIP device's soft AP will be a manual step until
15 > pairing is implemented.
16
17 ## Requirements for building
18
19 You need Android SDK 21 & NDK downloaded to your machine. Set the
20 `$ANDROID_HOME` environment variable to where the SDK is downloaded and the
21 `$ANDROID_NDK_HOME` environment variable to point to where the NDK package is
22 downloaded.
23
24 ## ABIs and TARGET_CPU
25
26 `TARGET_CPU` can have the following values, depending on your smartphone CPU
27 architecture:
28
29 | ABI         | TARGET_CPU |
30 | ----------- | ---------- |
31 | armeabi-v7a | arm        |
32 | arm64-v8a   | arm64      |
33 | x86         | x86        |
34 | x86_64      | x64        |
35
36 ## Building CHIPTool
37
38 Complete the following steps to build CHIPTool:
39
40 1. Check out the CHIP repository.
41
42 2. In the command line, run the following command from the top CHIP directory:
43
44     ```shell
45     sudo apt-get install -y swig # "brew install swig" for macOS.
46     TARGET_CPU=arm64 ./scripts/examples/android_app.sh
47     ```
48
49     See the table above for other values of `TARGET_CPU`.
50
51 3. Open the project in Android Studio and run **Sync Project with Gradle
52    Files**.
53
54 4. Use one of the following options to build an Android package:
55
56     - Click **Make Project** in Android Studio.
57     - Run the following command in the command line:
58
59         ```shell
60         cd src/android/CHIPTool
61         ./gradlew build
62         ```
63
64 The debug Android package `app-debug.apk` will be generated at
65 `./app/build/outputs/apk/debug/`.