Pixel devices as development platforms

This guide is mainly for developers who want to test and develop using AAOS

Caveats

These limitations apply when using a Pixel as development platforms:

There is a chance that you can brick your device, use it with caution!
  • The Pixel Tablet is verified and supported. You can visit Google Store to purchase it.

  • The following devices are supported but not actively tested. Be sure to download the correct binaries and then follow the instructions and change the commands as required:
    • Pixel 5
    • Pixel 6, 6a and 6Pro
    • Pixel 7, 7a and 7Pro
    • Pixel 8 and 8Pro
  • You must use Android 14 , build android-14.0.0_r30.

  • Limited support for Bluetooth profiles and some of the profiles will not work at all
  • Tablet does not support GPS, location requires "mock location app or similar"

Prerequisites

Before you continue, confirm you have the following items:

  1. OEM unlocking is required.
  2. Linux desktop capable of building Android code. For more information, see Establishing a Build Environment.

Code sync and build

  1. To sync Android build AP1A.240405.002 :
    mkdir aaos_on_pixel
    cd aaos_on_pixel
    REPO_ALLOW_SHALLOW=0 repo init -c -u https://android.googlesource.com/platform/manifest -b android-14.0.0_r30 --use-superproject --partial-clone --partial-clone-exclude=platform/frameworks/base --clone-filter=blob:limit=10M 
    repo sync -j32
  2. Download the vendor image for pixel devices from developers.google.com for AP1A.240405.002
    curl --output - https://dl.google.com/dl/android/aosp/google_devices-tangorpro-ap1a.240405.002-8d141153.tgz  | tar -xzvf -
    tail -n +315 extract-google_devices-tangorpro.sh | tar -zxvf -
  3. Take a patch
    cd packages/services/Car
    git fetch https://android.googlesource.com/platform/packages/services/Car refs/changes/83/3037383/2 && git cherry-pick FETCH_HEAD #fix the audio crash
    cd -
  4. Run the build. :
    . build/envsetup.sh
    lunch aosp_tangorpro_car-ap1a-userdebug
    m
  5. Build the Automotive-related packages:
    m android.hardware.automotive.vehicle@2.0-default-service android.hardware.automotive.audiocontrol-service.example 

Set up the device to flash the build

If you haven't already done so, enable Developer options. Go to Settings > System > About Phone and then tap Build Number seven times.

When you've enabled Developer options:

  1. Go to Settings > System > Developer options and enable USB debugging and OEM unlocking:
USB bebugging OEM unlocking

Flash the build

  1. To place the device into fastboot mode and then unlock it:
    adb reboot bootloader
    fastboot flashing unlock
  2. On the device, select Unlock the Bootloader. Doing so erases all data on the device!
  3. To flash the build:
    fastboot -w flashall
  4. After the build start booting with animation:
    1. To enable adb remount:
      #Temporary disable the userdata checkpoint 
      adb wait-for-device root; sleep 3; adb shell vdc checkpoint commitChanges; sleep 2 
      #Enable remount
      adb remount && sleep 2 && adb reboot && echo "rebooting the device" && adb wait-for-device root && sleep 5 && adb remount
    2. To push the required Automotive-specific files to the device:
      adb sync vendor && adb reboot
    3. Wait for the device to start:

    Tips

  5. If you see screen brightness too low:
    adb shell settings put system screen_brightness 255
  6. Boot when charger is plugged in:
    adb reboot bootloader 
    fastboot oem off-mode-charge 1
    fastboot reboot
  7. Enable Mock location:
        adb unroot
        adb shell cmd location set-location-enabled true
        adb root
        adb shell appops set 0 android:mock_location allow
        adb shell cmd location providers add-test-provider gps
        adb shell cmd location providers set-test-provider-enabled gps true
        adb shell cmd location providers set-test-provider-location gps --location 37.090200,-95.712900
        #To verify
        adb shell dumpsys location | grep "last location"
  8. For any issues contact aaos-on-phone@google.com