Skip to content

Extensive guide to walk you though the steps of installing & configuring Android Auto on emulators.

License

Notifications You must be signed in to change notification settings

CKAndroidProject/Android-Auto-Ultimate-Dev-Unit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Auto - Ultimate Dev Unit

ICONOMI - The world’s largest crypto strategy provider GNU General Public License Buy me a Coffee as a way to sponsor this project!

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

Desktop - Android Studio File => Settings => Appearance & Behavior => System Settings => Android SDK:

  1. Android SDK Location => Edit => Configure Path => Next => Next => Finish
  2. SDK Tools => Install:
    • Android Auto API Simulators
    • Android Auto Desktop Head Unit Emulator
    • Android Emulator
    • Android SDK Platform-Tools
  3. Make the Emulators executable
    chmod u+x <android-sdk-path>/extras/google/auto/desktop-head-unit
    chmod u+x <android-sdk-path>/tools/emulator

2. Installation - AVD (Android Virtual Device)

Desktop - Android Studio Tools => Device Manager

  1. 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
  2. AVD-Name => Start => Wait for initial boot
  3. AVD Window => Triple Dot Icon => Bug report => Uncheck Sceenshot + Bug report data

3. Root AVD

Desktop - Favorite terminal of choice:

  1. Make sure your AVD has booted properly / is running.
  2. Git clone the rootAVD script:
    git clone https://github.com/newbit1/rootAVD.git
  3. Make it executable
    chmod u+x ./rootAVD/rootAVD.sh
  4. List all AVDs
    ./rootAVD/rootAVD.sh ListAllAVD
  5. Root the desired AVD, e.g:
    ./rootAVD/rootAVD.sh <android-sdk-path>/system-images/android-33/google_apis/x86_64/ramdisk.img
  6. Wait for the script to finish / for the device to reboot. If it doesn't reboot automatically after script completion, then try manually

AVD:

  1. 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
  2. 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
  3. Magisk Manager (hidden as Settings) => Settings => Magisk => Check Zygisk => Reboot

4. Installation - King Installer

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:

  1. Download and install the latest King Installer release through your File Manager
  2. 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

Other options

  • 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)

5. Installation - Android Auto

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.

AVD:

  1. Download and install the latest aa4mg release (Through Magisk Manager) => Reboot
  2. Settings => Apps => See all apps => Android Auto => Mobile data & Wi-Fi => UnCheck all
  3. Download and install the latest Android Auto x86_64 release from APKMirror (Through King Installer)
  4. 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
  5. Settings => Connected Devices => Connection Preferences => Android Auto => General => Check Taskbar widgets
  6. Settings => Notifications => Device & app notifications => Android Auto => Check Allow notification access => Ok (Settings will still be restricted!)
  7. Settings => Apps => See all apps => Android Auto => Triple dot icon => Allow restricted settings
  8. Settings => Notifications => Device & app notifications => Android Auto => Check Allow notification access => Allow

6. Install - Android Auto for phone screens

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.

  1. Download and install Android Auto for phone screens from the aa4mg stubs folder (Through King Installer)
  2. Download and install LSPosed (Zygisk) + Shamiko (Through Magisk Manager) => Reboot
  3. Download and install Android-Auto-Xposed-Unlocked (Through King Installer)
  4. Notifications => LSPosed => Create shortcut => Add to homescreen
  5. LSPosed => Modules => Check Enable module + Check Android Auto => Reboot

7. Installation - Hail

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:

  1. Download and install Hail
  2. Hail
    • Settings => Working mode => Check Superuser - Disable (or Shizuku - Disable if you use Shizuku) => Grant root permissions
    • Apps => Filter icon => Check System => Check Maps
    • Home => Triple dot icon => Freeze current

8. Usage

Phone <=> Desktop Head Unit

Phone: Plug USB into Desktop

Desktop - Favorite terminal of choice:

<android-sdk-path>/extras/google/auto/desktop-head-unit --usb

AVD <=> Desktop Head Unit

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

AVD without Android Studio

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>

More commands

# 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!

About

Extensive guide to walk you though the steps of installing & configuring Android Auto on emulators.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published