Modify BUILD.md for building on Android

This commit is contained in:
robotchaoX 2023-06-09 13:22:48 +08:00
parent 71b5d83525
commit d7e42983a9

View file

@ -23,21 +23,21 @@ Use the provided CMakeLists.txt with [CMake](https://cmake.org) to generate a bu
Building on Android is done using the [Gradle Build Tool](https://gradle.org/):
Set Android SDK/NDK by environment variable `ANDROID_SDK_ROOT`/`ANDROID_NDK_HOME`.
If you want to build it through command line, set Android SDK/NDK by environment variable `ANDROID_SDK_ROOT`/`ANDROID_NDK_HOME`.
On Linux execute:
```
export ANDROID_SDK_ROOT=<path-to-SDK>
export ANDROID_NDK_HOME=<path-to-NDK>
cd android
./gradlew assembleDebug
```
This will download gradle locally, build all samples and output the apks to ```android\examples\bin```.
This will download gradle locally, build all samples and output the apks to ```android/examples/bin```.
On Windows execute `gradlew.bat assembleDebug`.
On Windows execute ```gradlew.bat assembleDebug```.
If you want to build and install on a connected device or emulator image, run ```gradle installDebug``` instead.
If you want to build it through [Android Studio](https://developer.android.com/studio), open project ```android\build.gradle``` in Android Studio.
If you want to build it through [Android Studio](https://developer.android.com/studio), open project folder ```android``` in Android Studio.
## <img src="./images/applelogo.png" alt="" height="32px"> [iOS and macOS](xcode/)