Skip to content

Running the Demo App

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.

You also need:

  • the board connected over the USB 3.0 Type-C / OTG port
  • the demo-app repository cloned locally
  • java and Android SDK installed
    • If you use nix, you can use nix develop to access the packages

From the laptop, confirm that Android on the board is visible over adb:

Terminal window
adb devices

If the board does not appear here, stop and fix the USB or board boot state before trying to deploy the app.

Terminal window
just demo-app/build

That produces a signed debug APK at:

demo-app/app/build/outputs/apk/debug/app-debug.apk

Use adb to replace any existing debug build on the board:

Terminal window
just demo-app/install

This builds and installs the app.

The debug build uses the package name com.example.displayapp.debug. Start it with:

Terminal window
just demo-app/run

If you want to restart from a clean app process first:

Terminal window
just demo-app/redeploy
Terminal window
adb logcat
adb shell pm list packages | rg displayapp
adb shell dumpsys package com.example.displayapp.debug

If adb install fails because of signatures or stale state, remove the existing debug package and reinstall:

Terminal window
just demo-app/uninstall
just demo-app/install

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.

  1. Install Android Studio
    • Instructions vary depending on operating system. You can figure this out on your own.
  2. 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
  3. Clone the demo-app repository locally
  4. Open the demo-app directory in Android Studio
  5. Set up Android Automotive Virtual Device
    • Docs are here
    • “Automotive (1408p landscape)” is known to work
  6. Click the “run app” button in the top bar (also can be triggered with Shift + F10)
  7. Use the little kebab button in the emulator to open “Extended Controls”
  8. 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