Skip to content

Commit e220c23

Browse files
authored
[docs] Improve instructions for building Android. (#22462)
* [docs] Improve instructions for building Android. * [docs] [android] Clarify where to find Sync Project with Gradle.
1 parent 7a45a4b commit e220c23

File tree

1 file changed

+45
-10
lines changed

1 file changed

+45
-10
lines changed

docs/guides/android_building.md

+45-10
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ There are following Apps on Android
1515

1616
<hr>
1717

18-
- [Source files](#source)
19-
- [Requirements for building](#requirements)
20-
- [ABIs and TARGET_CPU](#abi)
21-
- [Gradle & JDK Version](#jdk)
22-
- [Preparing for build](#preparing)
23-
- [Building Android CHIPTool from scripts](#building-scripts)
24-
- [Building Android CHIPTool from Android Studio](#building-studio)
25-
- [Building Android CHIPTest from scripts](#building-chiptest-scripts)
18+
- [Building Android](#building-android)
19+
- [Source files](#source-files)
20+
- [Requirements for building](#requirements-for-building)
21+
- [Linux](#linux)
22+
- [MacOS](#macos)
23+
- [ABIs and TARGET_CPU](#abis-and-target_cpu)
24+
- [Gradle & JDK Version](#gradle--jdk-version)
25+
- [Preparing for build](#preparing-for-build)
26+
- [Building Android CHIPTool from scripts](#building-android-chiptool-from-scripts)
27+
- [Building Android CHIPTool from Android Studio](#building-android-chiptool-from-android-studio)
28+
- [Building Android CHIPTest from scripts](#building-android-chiptest-from-scripts)
2629

2730
<hr>
2831

@@ -39,11 +42,43 @@ directory.
3942

4043
## Requirements for building
4144

42-
You need Android SDK 21 & NDK downloaded to your machine. Set the
45+
You need Android SDK 21 & NDK 21.4.7075529 downloaded to your machine. Set the
4346
`$ANDROID_HOME` environment variable to where the SDK is downloaded and the
4447
`$ANDROID_NDK_HOME` environment variable to point to where the NDK package is
4548
downloaded.
4649

50+
1. Install [Android Studio](https://developer.android.com/studio)
51+
2. Install NDK:
52+
1. Tools -> SDK Manager -> SDK Tools Tab
53+
2. Click [x] Show Package Details
54+
3. Select NDK (Side by Side) -> 21.4.7075529
55+
4. Apply
56+
3. Install Command Line Tools:
57+
1. Tools -> SDK Manager -> SDK Tools Tab -> Android SDK Command Line Tools
58+
(latest)
59+
2. Apply
60+
4. Install SDK 21:
61+
1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 5.0 (Lollipop) SDK
62+
Level 21
63+
2. Apply
64+
5. Install Emulator:
65+
1. Tools -> Device Manager -> Create device -> Pixel 5 -> Android S API 31
66+
-> Download
67+
68+
### Linux
69+
70+
```
71+
export ANDROID_HOME=~/Android/Sdk
72+
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/21.4.7075529
73+
```
74+
75+
### MacOS
76+
77+
```
78+
export ANDROID_HOME=~/Library/Android/sdk
79+
export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk/21.4.7075529
80+
```
81+
4782
<a name="abi"></a>
4883

4984
### ABIs and TARGET_CPU
@@ -136,7 +171,7 @@ which allows us to directly edit core Matter code in-IDE.
136171
and `matterSourceBuildAbiFilters` to the desired ABIs in
137172
[src/android/CHIPTool/gradle.properties](https://github.com/project-chip/connectedhomeip/blob/master/src/android/CHIPTool/gradle.properties)
138173

139-
3) Open the project in Android Studio and run **Sync Project with Gradle
174+
3) Open the project in Android Studio and run **File -> Sync Project with Gradle
140175
Files**.
141176

142177
4) Use one of the following options to build an Android package:

0 commit comments

Comments
 (0)