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
    Pixel 7 Pro
    Pixel 7a
    Pixel 6
    Pixel 6 Pro
    Pixel 6a
    Pixel 5
    Pixel 5a
  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.