From 87022cabd193f40d7ba65308f371d0f0bd34019d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Ju=C3=A1rez=20L=C3=B3pez?= Date: Wed, 28 Aug 2024 13:16:27 -0400 Subject: [PATCH] Update android example setup README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add rust installation instructions - Update NDK version - Add bazel test instructions Signed-off-by: Miguel Juárez López --- examples/README.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/examples/README.md b/examples/README.md index 90270109..32028c67 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 @@ -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) @@ -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) @@ -86,6 +93,17 @@ 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 Sutdio, 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. @@ -93,11 +111,3 @@ 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`