Skip to content

Commit

Permalink
Update android example setup README.md (#11)
Browse files Browse the repository at this point in the history
* Update android example setup README.md

- Add rust installation instructions
- Update NDK version
- Add bazel test instructions

Signed-off-by: Miguel Juárez López <[email protected]>

* Update examples/README.md

Co-authored-by: Rafał Augustyniak <[email protected]>
Signed-off-by: Miguel Juárez López <[email protected]>

---------

Signed-off-by: Miguel Juárez López <[email protected]>
Signed-off-by: Miguel Juárez López <[email protected]>
Co-authored-by: Rafał Augustyniak <[email protected]>
  • Loading branch information
murki and Augustyniak authored Aug 28, 2024
1 parent d725d12 commit 7294fc0
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,18 @@ brew install --cask zulu-jdk8 zulu-jdk11 zulu-jdk-17

To install without Homebrew you can follow these instructions: [https://docs.azul.com/core/zulu-openjdk/install/macos](https://docs.azul.com/core/zulu-openjdk/install/macos)

### 2. Import hello-world project into Android Studio
### 2. Install Rust

Install it locally using [their installation script](https://www.rust-lang.org/tools/install)

`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`

make sure to add it to your path, e.g.

`echo 'export PATH="~/.cargo/bin:$PATH"' >> ~/.zshrc`

### 3. Import demo app project into Android Studio

To use Android Studio:
- Install [Android Studio](https://developer.android.com/studio/archive/). The latest verified-to-work version is Android Studio Jellyfish | 2023.3.1 Patch 1. When asked to choose between default or custom installation selecting standard works fine.

#### Opening Loop SDK project in Android Studio with Gradle
Expand All @@ -41,7 +50,7 @@ Setup the environment, open Android Studio.

![](../docs/images/android_local_gradle_error.png)

- Go to Tools > SDK Manager > Android SDK > SDK Tools. Make sure that "Show Package Details" is checked and install the NDK version that is required by the project (currently `25.2.9519653`).
- Go to Tools > SDK Manager > Android SDK > SDK Tools. Make sure that "Show Package Details" is checked and install the NDK version that is required by the project (currently `27.0.12077973`).

![](../docs/images/android_local_gradle_ndk.png)

Expand All @@ -58,8 +67,6 @@ Setup the environment, open Android Studio.
rustup target add x86_64-linux-android
```



#### Opening Loop SDK project in Android Studio with Bazel

- Install [bazel plugin](https://plugins.jetbrains.com/plugin/9185-bazel-for-android-studio)
Expand All @@ -86,18 +93,21 @@ Set up the environment, open Android Studio.

![](../docs/images/android_local_dev_sync.png)

#### Run tests
To run only the JVM tests from command line with bazel use:
`./bazelw test //platform/jvm/...`

- If you get an error trying to run tests from Android Studio, you need to install LLVM
`brew install llvm`

and add it to your path, e.g.

`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc`

#### Entering debugging session

With the project ready, you can now start debugging with Android Studio.

1. From Android Studio select one of the available configurations. Note: If you do not see any configuration available either restart Android Studio or click "Add configuration" and select a desired configuration.
1. Hit the debug icon.
1. Optionally you could create symbolic breakpoints before running by going to the Debugger tab.

### 3. Install LLVM so you can run unit tests in Android Studio

`brew install llvm`

and add it to your path, e.g.

`echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.zshrc`

0 comments on commit 7294fc0

Please sign in to comment.