Set up a device or emulator image

To perform end-to-end testing with the Beta version of Privacy Sandbox on Android, you need to interact with an Android 13 device. You can either request to add your Android 13 device to the Beta allowlist, or use a Beta-approved emulator image provided in the AdServices SDK Extension. (Not required for Developer Preview versions.)

Set up an Android 13 device

The Privacy Sandbox on Android Beta program begins in early 2023, starting with a small percentage of supported Android 13 devices. During the initial rollout stages, you can set up your own device for early testing if you join the early testers program. This lets you test the Privacy Sandbox APIs on a limited number of your own Android 13 devices and apps.

To make sure your device is running the latest module versions:

  1. Sign in to your Android 13 device with a Google Account.
  2. Go to Settings > Security & privacy > Updates > Google Play system update to ensure your device is up to date. Select Update as necessary.
  3. When the Google Play system update is complete, reboot the device.
  4. Check to see if the SDK Extensions are available on the device.

Set up an Android 13 device with a Developer Preview image

Ad techs testing emerging features may want to install a Developer Preview image. Features and APIs are subject to change.

  1. Download your preferred device image from the following list of Android 13 devices:

    Device Download Link and SHA-256 Checksum
    Pixel 7
    3be2ca79f36839ca1facc98c9cc9ea200fd938dafd44f001ae24a029471a7e2f
    Pixel 7 Pro
    165314bf06543d705f3a24624ec610ed359d3443464ce21d6cdf4d8328d45707
    Pixel 7a
    e0aff67beebb97e44f18d5513058249961dde0beabbfb048197ef2e4b42b7d6a
    Pixel 6
    cd9d22a9b6d786cdcdcbc99da68ccb1c3447797afa43195081d179f9d7f53c3d
    Pixel 6 Pro
    ce8d295eb5a1618254606c2d3ffb0c7b9f4d4f90d71df9577ba7bc2e22aad808
    Pixel 6a
    2c1731f7f55f2c130274404e7d109f6e554700612938137640db563f9399732a
    Pixel 5
    a9b536a1a418916cf413d4b69d5cc1696a3aaa367f1f5401952ed91872b1d8f1
    Pixel 5a
    4a1af1af8019cec11784e88994887f2ffd45505ee0e768ccc9e70e09920feadf
  2. Back up your Android Pixel device's data.

  3. Flash the device image onto your Android 13 device.

Flash your device using Android Flash Tool

Android Flash Tool lets you securely flash a Privacy Sandbox on Android system image to your supported Pixel device. Android Flash Tool works with any Web browser that supports WebUSB, such as Chrome or Edge 79+.

Android Flash Tool guides you step-by-step through the process of flashing your device. There's no need to have tools installed, but you need to unlock your device and enable USB Debugging in Developer options. For complete instructions, see the Android Flash Tool documentation.

Connect your device over USB, then navigate to Android Flash Tool and follow the onscreen guidance. For complete instructions, see the Android Flash Tool documentation.

Set up an Android device emulator image

To set up a Developer Preview emulator image to run the Privacy Sandbox on Android, do the following:

  1. Install the latest Canary build or Stable build of Android Studio.
  2. In Android Studio, go to Settings > Languages & Frameworks > Android SDK.
  3. In the SDK Tools tab, select the latest version of Android Emulator, and click OK. This action installs the latest version if it isn't already installed.
  4. Go to Tools > Device Manager, follow the instructions on the page that appears, and select Create device.
  5. If you don't already have a Privacy Sandbox on Android system image installed that matches your device definition, click Download next to the "UpsideDownCake (Extension Level 4)" Release Name to get it.
  6. Return to the list of virtual devices in the Device Manager, and then select the Launch this AVD action for your Privacy Sandbox on Android virtual device to start it.
  7. Once the device has started, proceed to configure the device to use the Privacy Sandbox.