Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions docs/root/development/debugging/android_local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Setting up the environment
Before we start, you'll need to download Android Studio and the `Bazel plugin <https://plugins.jetbrains.com/plugin/9185-bazel>`_, you can find it in Preferences -> Plugins
.

1. Go `here <https://developer.android.com/studio/>`_ and install Android Studio.
1. Go `here <https://developer.android.com/studio/>`_ and install Android Studio
2. Install the bazel plugin

Adding Envoy-Mobile Project into Android Studio
Expand Down Expand Up @@ -51,16 +51,8 @@ Entering a debugging session

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

1. Compile your envoy-mobile with debug symbols to the architecture of the device or emulator you are about to run.

For example:
::

$ ./bazelw build android_dist --config=android --fat_apk_cpu=x86 -c dbg

Android supported archs are `arm64_v8a`, `armeabi-v7a`, `x86`, `x86_64`.

2. From Android Studio select the `Example App x86 (Debug)` configuration and hit the debug icon. Note: if you don't see this option go to "Add configuration" and it'll be there on the Bazel category, just select it and hit Ok.
1. From Android Studio select either `Example App (Debug) [x86]` or `Example App (Debug) [arm64]` configuration. Note: the `x86` configuration doesn't work on ARM machines (i.e., M1 Macbooks).
2. Hit the debug icon. Note: if you don't see this option go to "Add configuration" and it'll be there on the Bazel category, just select it and hit Ok.
3. Optionally you could create symbolic breakpoints before running by going to the Debugger tab.

Your environment should look like this at this point:
Expand Down
1 change: 1 addition & 0 deletions examples/kotlin/hello_world/.bazelproject
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ directories:

import_run_configurations:
examples/kotlin/hello_world/tools/android-studio-run-configurations/run_configuration_example_debug_x86.xml
examples/kotlin/hello_world/tools/android-studio-run-configurations/run_configuration_example_debug_arm64.xml

targets:
//examples/kotlin/hello_world:hello_envoy_kt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<configuration name="Example App (Debug) [arm64]"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this configuration is basically a copy-paste of the existing x86 run configuration

type="BlazeCommandRunConfigurationType"
factoryName="Bazel Command"
nameIsGenerated="false">
<blaze-settings kind="android_binary"
blaze-command="mobile-install"
handler-id="BlazeCommandGenericRunConfigurationHandlerProvider"
blaze-native-debug="true"
DEEP_LINK=""
ACTIVITY_CLASS=""
MODE="default_activity"
launch-method="NON_BLAZE"
use-split-apks-if-possible="false"
use-work-profile-if-present="false"
show-logcat-automatically="false"
AM_START_OPTIONS="">
<blaze-user-flag>--fat_apk_cpu=arm64-v8a</blaze-user-flag>
<blaze-target>//examples/kotlin/hello_world:hello_envoy_kt</blaze-target>
<Profilers>
<option name="ADVANCED_PROFILING_ENABLED"
value="false" />
<option name="STARTUP_PROFILING_ENABLED"
value="false" />
<option name="STARTUP_CPU_PROFILING_ENABLED"
value="false" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME"
value="Sample Java Methods" />
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED"
value="false" />
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES"
value="2048" />
</Profilers>
</blaze-settings>
<method v="2">
<option name="Blaze.BeforeRunTask"
enabled="true" />
</method>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<configuration name="Example App x86 (Debug)"
<configuration name="Example App (Debug) [x86]"
type="BlazeCommandRunConfigurationType"
factoryName="Bazel Command"
nameIsGenerated="false">
Expand Down