-
Notifications
You must be signed in to change notification settings - Fork 11
Set‐up Full Virtual Android Auto Head Unit Debugging
As it can be tricky to get the Desktop Head Unit to work in combination with an Android Virtual Device, This page details the steps needed to set up a working virtual device chain for testing and debugging.
The main problem with current AVD's is that the x86_64 platform is no longer supported through the play store and automatic updates will require an update to the latest version of the app.
Following these steps should result in a working virtual device chain:
-
Have these SDK tools installed:
-
Created a AVD using the Pixel 3 with Play Store template (constrained by current hardware...):
-
Selected the Android 13 Google Play image (started with this, other versions might work the same)
-
Booted the AVD, logged in with my test gmail, skipped all the set-up and disabled automatic updates in the play store.
-
Downloaded and installed the latest x86_64 Android Auto apk (currently https://www.apkmirror.com/apk/google-inc/android-auto/android-auto-12-6-6432-release/android-auto-12-6-643248-release-android-apk-download/) And installed it through adb:
adb install "<APK Download Path>\com.google.android.projection.gearhead_12.6.643248-release-126643248_minAPI26(x86_64)(nodpi)_apkmirror.com.apk"
-
Started ReFreezer in debug mode (in my case from VsCode)
ReFreezer needs to be running on the device first before android auto is connected in order for tracks to be able to play from the head unit. When the app is launched from the head unit directly, it uses a different entry point (not the MainActivity.java) and thus doesn't create the method channel to start the streaming server. -
Activated Developer Mode in the device (7 taps on build number)
-
Activated Developer Mode in Android Auto
- Settings => Connection Preferences => Android Auto => 7 taps on "Version"
-
In Android Auto changed the following Developer Settings (access through the 3 dots, top right):
- Wireless Android Auto => checked
- Application Mode => Developer
- Unknown Sources => checked
-
(Optional I think) Checked in "Customise Launcher" for Android Auto that ReFreezer was listed and checked
-
Started the Head Unit Server from Android Auto menu (access through the 3 dots, top right).
-
Forward the server port in adb:
adb forward tcp:5277 tcp:5277
-
Start the DHU:
<AndroidSDK Path>\extras\google\auto>desktop-head-unit
-
The DHU should start and connect to the running AVD. Just followed the on screen instruction to grant the requested permissions and start ReFreezer from DHU launcher:
Debugging now works through both virtual devices.