This extensive guide will walk you though the steps of installing & configuring up a very handy emulator setup, to develop & debug Android Auto apps / mods, without needing to walk back and forth to your car for testing!
These steps where written on / for Linux users, but the process should be nearly identical for Mac / Windows users.
- Android Auto - Ultimate Dev Unit
- Table of contents
- Pre-requisites
- 1. Installation - Phone Emulator Head Unit Emulator SDK Platform-Tools
- 2. Installation - AVD (Android Virtual Device)
- 3. Root AVD
- 4. Installation - King Installer
- 5. Installation - Android Auto
- 6. Installation - Android Auto for phone screens
- 7. Installation - Android Auto - Xposed Unlocked
- 8. Installation - Hail
- 9. Usage
Desktop - Android Studio File => Settings => Appearance & Behavior => System Settings => Android SDK:
- Android SDK Location => Edit => Configure Path => Next => Next => Finish
- SDK Tools => Install:
- Android Auto API Simulators
- Android Auto Desktop Head Unit Emulator
- Android Emulator
- Android SDK Platform-Tools
- Make the Emulators executable
chmod u x <android-sdk-path>/extras/google/auto/desktop-head-unit chmod u x <android-sdk-path>/tools/emulator
Desktop - Android Studio Tools => Device Manager
- Create device
- Choose a device definition: Phone => Pixel 6 Pro (Or your preference) => Next
- Select a system image: Recommended => Tiramisu / 33 / x86_64 / Android 13.0 (Google APIs) (Or your preference) => Download => Next
- Verify Configuration: Show Advanced Settings
- UnCheck
Enable Device Frame
- Alter to your preference (E.g. AVD-Name, CPU cores, RAM)
- Finish
- UnCheck
- AVD-Name => Start => Wait for initial boot
- AVD Window => Triple Dot Icon => Bug report => Uncheck
Sceenshot
Bug report data
Desktop - Favorite terminal of choice:
- Make sure your AVD has booted properly / is running.
- Git clone the
rootAVD
script:git clone https://github.com/newbit1/rootAVD.git
- Make it executable
chmod u x ./rootAVD/rootAVD.sh
- List all AVDs
./rootAVD/rootAVD.sh ListAllAVD
- Root the desired AVD, e.g:
./rootAVD/rootAVD.sh <android-sdk-path>/system-images/android-33/google_apis/x86_64/ramdisk.img
- Wait for the script to finish / for the device to reboot. If it doesn't reboot automatically after script completion, then try manually
AVD:
- Settings
- About Emulated Device => Tap build number a lot => Developer options unlocked
- System => Developer options => Uncheck
Automatic system updates
(To prevent losing root due to system updates) - Apps => See all apps => Magisk => Install unknown sources => Allow from this source => Ok
- Magisk Manager
- Allow notifications
- Requires Additional Setup => Ok => Wait for reboot
- Settings => App => Hide the Magisk app => Grant super user access => Restore the Magisk app => Add shortcut to home screen
- Magisk Manager (hidden as
Settings
) => Settings => Magisk => CheckZygisk
=> Reboot
Android Auto requires that applications are installed through the Google Play Store to be usable.
So we need to spoof the installer during installation, to "install as Google Play Store".
In this guide we'll install the applications we seek to use through King Installer
(With Enable if you use rooted (LineageOS) phone
checked)
AVD:
- Download and install the latest King Installer release through your File Manager
- Settings => Apps
- Special app access => All files access => KingInstaller => Check
Allow access to manage all files
- See all apps => KingInstaller => Install unknown apps => Check
Allow from this source
- Special app access => All files access => KingInstaller => Check
To verify if the process of installing an app "as Google Play Store" went correctly, check as following:
AVD:
- Settings => Apps => See all apps => Name of installed App => Store (at the bottom)
- There you should see either of following,
App installed from ...
messages:license checker
- On AVDs without Google PlayFakeStore
- On AVDs with MicroG (Google Play Store stub)Google Play Store
- On AVDs with Google Play Store enabled
- Aurora Store (With
Root installer
as the installation method enabled!) - ADB
adb push <path-to-apk>/android-auto.apk /data/local/tmp/android-auto.apk adb shell su -c pm install -i "com.android.vending" /data/local/tmp/android-auto.apk
- Package Manager (Not recommended, because it doesn't spoof "as Google Play Store", but works for some apps)
The default Android Auto stub in the system partition of AVDs prevents the installation of full Android Auto on AVDs. To work around this, we'll replace the original AA stub with a patched one, provided by aa4mg (Android Auto for MicroG).
AVD:
- Download and install the latest aa4mg release (Through Magisk Manager) => Reboot
- Settings => Apps => See all apps => Android Auto => Mobile data & Wi-Fi => UnCheck all
- Download and install the latest Android Auto x86_64 release from APKMirror (Through King Installer)
- Settings => Connected Devices => Connection Preferences => Android Auto
- System => UnCheck
Google Analytics
- About =>Tap version number a lot => Allow development settings => Ok
- Triple dot icon => Developer settings
- Application Mode => Developer
- Check
Force debug logging
- Check
Unknown Sources
- Check
Enable debug overlay
- Close App
- System => UnCheck
- Settings => Connected Devices => Connection Preferences => Android Auto => General => Check
Taskbar widgets
- Settings => Notifications => Device & app notifications => Android Auto => Check
Allow notification access
=> Ok (Settings will still be restricted!) - Settings => Apps => See all apps => Android Auto => Triple dot icon => Allow restricted settings
- Settings => Notifications => Device & app notifications => Android Auto => Check
Allow notification access
=> Allow
The Android Auto app likely won't open directly anymore,
we'll use the Android Auto for phone screens shortcut launcher app to work around this.
AVD:
- Download and install Android Auto for phone screens from the aa4mg
stubs
folder (Through King Installer) - Settings => Apps => See all apps => Android Auto for phonescreens => Mobile data & Wi-Fi => UnCheck all
Some apps have additional restrictions applied to them.
To make these work correctly / reliably we'll need some additional Xposed hooks.
AVD:
- Download and install LSPosed (Zygisk) Shamiko (Through Magisk Manager) => Reboot
- Download and install Android-Auto-Xposed-Unlocked (Through King Installer)
- Notifications => LSPosed => Create shortcut => Add to homescreen
- LSPosed => Modules => Check
Enable module
CheckAndroid Auto
=> Reboot
Android Auto will launch the last used navigation app by default,
which can be annoying if you seek to develop / test things out.
In this guide we'll freeze Google Maps through Hail.
The benefit of this is that due to no navigation app being enabled,
the Android Auto Head Unit will always open straight in it's app launcher.
AVD:
- Download and install Hail
- Hail
- Settings => Working mode => Check
Superuser - Disable
(orShizuku - Disable
if you use Shizuku) => Grant root permissions - Apps => Filter icon => Check
System
=> CheckMaps
- Home => Triple dot icon => Freeze current
- Settings => Working mode => Check
Phone: Plug USB into Desktop
Desktop - Favorite terminal of choice:
<android-sdk-path>/extras/google/auto/desktop-head-unit --usb
AVD: Android Auto => Triple dot icon => Start head unit server
Desktop - Favorite terminal of choice:
adb forward tcp:5277 tcp:5277
<android-sdk-path>/extras/google/auto/desktop-head-unit --bridge
Desktop - Favorite terminal of choice:
# List all available AVDs
<android-sdk-path>/tools/emulator -list-avds
# Run <AVD-Name>
<android-sdk-path>/tools/emulator -avd <ADV-Name>
# List all available commands
<android-sdk-path>/extras/google/auto/desktop-head-unit -help
<android-sdk-path>/tools/emulator -help
Tip: Add some aliases to your .bashrc
or equivalent for the emulator
and desktop-head-unit
to make them easier to use!