Running the Demo App
Dev Board
Section titled “Dev Board”This path assumes the board already has a working Android Automotive image flashed and booted. If you have not done that yet, start with Flash OS.
Prerequisites
Section titled “Prerequisites”You also need:
- the board connected over the USB 3.0 Type-C / OTG port
- the
demo-apprepository cloned locally javaand Android SDK installed- If you use nix, you can use
nix developto access the packages
- If you use nix, you can use
Verify the board connection
Section titled “Verify the board connection”From the laptop, confirm that Android on the board is visible over adb:
adb devicesIf the board does not appear here, stop and fix the USB or board boot state before trying to deploy the app.
Build the debug APK
Section titled “Build the debug APK”just demo-app/buildThat produces a signed debug APK at:
demo-app/app/build/outputs/apk/debug/app-debug.apkInstall from the CLI
Section titled “Install from the CLI”Use adb to replace any existing debug build on the board:
just demo-app/installThis builds and installs the app.
Run the app from the CLI
Section titled “Run the app from the CLI”The debug build uses the package name com.example.displayapp.debug. Start it with:
just demo-app/runIf you want to restart from a clean app process first:
just demo-app/redeployUseful troubleshooting commands
Section titled “Useful troubleshooting commands”adb logcatadb shell pm list packages | rg displayappadb shell dumpsys package com.example.displayapp.debugIf adb install fails because of signatures or stale state, remove the existing debug package and reinstall:
just demo-app/uninstalljust demo-app/installAndroid Studio Emulator
Section titled “Android Studio Emulator”WARNING - Android Studio and the Android Emulator seem to be pretty resource-hungry, especially with RAM. It is recommended that you stop any other virtualization-related things on your machine (virtual machines and docker containers) before attempting to run the app locally on the emulator.
- Install Android Studio
- Instructions vary depending on operating system. You can figure this out on your own.
- Install Android Automotive System Image
- Docs are here
- “Android Automotive with Google APIs x86_64 System Image” (API level 34-ext9) is known to work
- Clone the
demo-apprepository locally - Open the
demo-appdirectory in Android Studio - Set up Android Automotive Virtual Device
- Docs are here
- “Automotive (1408p landscape)” is known to work
- Click the “run app” button in the top bar (also can be triggered with
Shift + F10) - Use the little kebab button in the emulator to open “Extended Controls”
- Trigger different inputs to the app using the extended controls
- Car data > Car sensor data gives you access to some high-level data inputs
- Car data > Vhal properties gives you even more access to data inputs - you can search for things like
EV_BATTERY_LEVEL - Car rotary gives you a handy rotary knob system as an alternative to the touchscreen