summaryrefslogtreecommitdiffhomepage
path: root/android/docs
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-01-08 09:33:44 +0100
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-01-08 10:48:48 +0100
commit1c1ca559b69810904538c2e46c2326d2ebcaa014 (patch)
treee42cb4535910bdeeb25018786035a21130e5ff31 /android/docs
parentac9ac4b824b62d60f64be46f69a4678152d64fb5 (diff)
downloadmullvadvpn-1c1ca559b69810904538c2e46c2326d2ebcaa014.tar.xz
mullvadvpn-1c1ca559b69810904538c2e46c2326d2ebcaa014.zip
Add gradle rust plugin
Diffstat (limited to 'android/docs')
-rw-r--r--android/docs/BuildInstructions.macos.md24
-rw-r--r--android/docs/DebugInstructions.md16
2 files changed, 24 insertions, 16 deletions
diff --git a/android/docs/BuildInstructions.macos.md b/android/docs/BuildInstructions.macos.md
index 78bf345d1d..0368c1e917 100644
--- a/android/docs/BuildInstructions.macos.md
+++ b/android/docs/BuildInstructions.macos.md
@@ -17,7 +17,7 @@ brew install --cask android-studio
Install the following packages:
```bash
-brew install protobuf gcc go openjdk@17 rustup-init
+brew install protobuf gcc go openjdk@17 rustup-init python3
```
> __*NOTE:*__ Ensure that you setup `openjdk@17` to be the active JDK, follow instructions in
@@ -38,7 +38,7 @@ Open Android Studio -> Tools -> SDK Manager, and install `Android SDK Command-li
Install the necessary Android SDK tools
```bash
-~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0" "platform-tools" "ndk;27.1.12297006"
+~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager "platforms;android-35" "build-tools;35.0.0" "platform-tools" "ndk;27.2.12479018"
```
Install Android targets
@@ -50,7 +50,7 @@ Export the following environmental variables, and possibly store them for exampl
`~/.zprofile` or `~/.zshrc` file:
```bash
export ANDROID_HOME="$HOME/Library/Android/sdk"
-export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/27.1.12297006"
+export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/27.2.12479018"
export NDK_TOOLCHAIN_DIR="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin"
export AR_aarch64_linux_android="$NDK_TOOLCHAIN_DIR/llvm-ar"
export AR_armv7_linux_androideabi="$NDK_TOOLCHAIN_DIR/llvm-ar"
@@ -74,10 +74,23 @@ git submodule update --init --recursive --depth=1 wireguard-go-rs
```
## 4. Debug build
+
+### Android Studio
+
+Create the file `android/local.properties` if it does not exist and add the following line:
+
+```bash
+rust.pythonCommand=/opt/homebrew/bin/python3
+```
+
+You should now be able to run the app directly from Android Studio.
+
+### `android/build.sh`
+
Run the build script in the root of the project to assemble all the native libraries and the app:
```bash
-./build-apk.sh --dev-build
+./android/build.sh --dev-build
```
Once the build is complete you should receive a message looking similar to this:
@@ -92,9 +105,6 @@ Once the build is complete you should receive a message looking similar to this:
**********************************
```
-Your native binaries have now been built, any subsequent builds that does not have changes to the
-native code can be done in Android Studio or using gradle.
-
# Build options and configuration
For configuring signing or options to your build continue with the general [build instructions](../BuildInstructions.md).
diff --git a/android/docs/DebugInstructions.md b/android/docs/DebugInstructions.md
index e4c9100e0e..9faa5237b2 100644
--- a/android/docs/DebugInstructions.md
+++ b/android/docs/DebugInstructions.md
@@ -1,15 +1,13 @@
## Debugging the native libraries in Android Studio with LLDB
-1. Make sure the native libraries have been built with debug symbols. If using the `build-apk.sh`
- script, run `SKIP_STRIPPING=yes ../build-apk.sh --dev-build`.
-2. In Android Studio, go to `Run -> Edit configurations...`
-3. Make sure the `app` configuration is selected.
-4. In the `Debugger` tab, select `Dual (Java + Native)`
-5. Start debugging the app as usual from Android Studio. The app should now stop on a SIGURG signal.
-6. Select the `LLDB` tab in the debugger. Now you can set breakpoints etc, e.g.
+1. In Android Studio, go to `Run -> Edit configurations...`
+2. Make sure the `app` configuration is selected.
+3. In the `Debugger` tab, select `Dual (Java + Native)`
+4. Start debugging the app as usual from Android Studio. The app should now stop on a SIGURG signal.
+5. Select the `LLDB` tab in the debugger. Now you can set breakpoints etc, e.g.
`breakpoint set -n open_tun`
-7. Before continuing run `pro hand -p true -s false SIGURG`
-8. Click `Resume Program` and the app will resume until the breakpoint is hit.
+6. Before continuing run `pro hand -p true -s false SIGURG`
+7. Click `Resume Program` and the app will resume until the breakpoint is hit.
NOTE: When running LLDB, Android Studio can sometimes get into a state where it will try to
connect to the debugger when running the app normally, which blocks the app from starting.