Test Android apps for cars

While developing your app, use the tools available to run Android Auto and Android Automotive OS:

Test in real vehicles

To test your app in real vehicles, you must install it from a trusted source such as Google Play, with one exception detailed in Allow unknown sources. You can use Internal App Sharing or an Internal Test Track to distribute your app to devices without going through the Google Play review process.

Allow unknown sources

Android Auto has a developer option that lets you run apps that aren't installed from a trusted source. This setting applies to media, messaging notifications, and parked apps but doesn't apply to apps built using the Android for Cars App Library.

Enable Android Auto developer mode

In addition to the Android developer options, which you can use on both Android Auto and Android Automotive OS, Android Auto has its own developer mode. To enable it, follow these steps:

  1. Open the Android Auto settings.

    • Android 10 (API level 29) or higher: on the device, tap Settings > Apps & notifications > See all apps > Android Auto > Advanced > Additional settings in the app.
    • Android 9 (API level 28) or lower: in the Android Auto app, tap the menu, then tap Settings.
  2. Go to the About section near the bottom and tap Version to display the version and permission information.

  3. Tap the Version and permission info section 10 times.

    The Allow development settings? dialog appears.

  4. Tap OK.

    You've enabled developer mode, and you can access developer options in the overflow menu. You only need to enable developer mode once. To quit developer mode, use the option from the drop-down menu in the app bar.

Additional testing requirements for media apps

If you're testing a media app, test for the scenarios covered in this section in addition to testing your app on Android Auto, Android Automotive OS, or both.

Test MediaBrowserService startup scenarios

To help keep drivers and passengers safe, users have additional restrictions on how they can interact with apps while driving. For this reason, Android Auto and Android Automotive OS have MediaBrowserService startup scenarios that your app must handle.

Test your app to make sure it can handle each of the following scenarios:

  • The MediaBrowserService runs before any Activity opens.
  • The MediaBrowserService runs when no Activity can be shown.
  • The MediaBrowserService runs when the user isn't signed in.

While testing for these scenarios, be sure to try the following methods:

  • Force stop the app, and then launch it.
  • Clear the app data, and then launch it.

Also make sure to set an appropriate error message when necessary.

Use the Media Controller Test app

The Media Controller Test app lets you test the intricacies of media playback on Android and helps verify your media session implementation. To get started with this tool, see Using the media controller test app.