How to develop locally?
Recommended setup:
-
IDE: Visual Studio Code
-
Extensions:
-
Note: CodeLLDB v1.11.2 has a bug when launching with Android Debug (issue link). Please downgrade to v1.11.1 via Extensions tab > CodeLLDB > Install Specific Version... > v1.11.1 to work around the issue.
How to debug
- Open Visual Studio Code.
- Launch the
[Android] Debug
configuration from the debug panel. This will:- Build the Rust code into an APK.
- Install the APK on a selectable device, and launch the app in debug mode.
- Redirect stdout/stderr output to the terminal.
Tip: You can debug the app on either a physical device or a virtual device.
How to view the error logs
If Local Desktop hangs at launch, stuck on the app icon, it is likely that the native main thread has crashed. To check:
- Search for
> Tasks: Run Task
in the Command Palette. - Run the
[Android] Logcat
task. Then you will see the log:05-24 18:10:04.181 13540 13556 I RustStdoutStderr: thread '<unnamed>' panicked at src/utils/logging.rs:17:14:
05-24 18:10:04.181 13540 13556 I RustStdoutStderr:
05-24 18:10:04.181 13540 13556 I RustStdoutStderr: *** *** *** [POLAR BEAR EXPECTATION] *** *** ***
05-24 18:10:04.181 13540 13556 I RustStdoutStderr: Failed to create EGLContext
05-24 18:10:04.181 13540 13556 I RustStdoutStderr: *** *** *** [POLAR BEAR EXPECTATION] *** *** ***
You can also assign a shortcut to quickly view the log. To do so:
- Search for
> Preferences: Open Keyboard Shortcuts (JSON)
in the Command Palette.- Add this entry to the opened
keybindings.json
file:{
"key": "shift+cmd+l",
"command": "workbench.action.tasks.runTask",
"args": "[Android] Logcat"
}