[null,null,["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Test Android apps for cars\n\nWhile developing your app, there are a variety of tools available to run Android\nAuto and Android Automotive OS:\n\n- See [Test your app using the Desktop Head Unit](/training/cars/testing/dhu) for details on how to install and use the Desktop Head Unit to run Android Auto apps.\n- See [Test your app using the Android Automotive OS emulator](/training/cars/testing/emulator) for details on how to install and run Android Automotive OS images.\n- See [Test using Android Automotive OS on Pixel Tablet](/training/cars/testing/aaos-on-pixel) for details on how to install Android Automotive OS on a Pixel Tablet. Certain images also support use as an Android Auto receiver.\n- See [Access Android Automotive OS devices through Firebase Test Lab](/training/cars/testing/firebase) for details on how to test on real car hardware using Firebase Test Lab.\n\n| **Important:** In addition to testing your app's user experience, ensure that your app meets all of the criteria listed on the [Android app quality for cars](/docs/quality-guidelines/car-app-quality) page for your app's category before you submit your app to Google Play for review.\n\nTest in real vehicles\n---------------------\n\nTo test your app in real vehicles, it must be installed from a trusted source\nsuch as the Play Store, with one exception detailed in [Allow unknown\nsources](#unknown-sources). You can use [Internal App\nSharing](https://play.google.com/console/about/internalappsharing/)\nor an [Internal Test Track](https://play.google.com/console/about/internal-testing/)\nto distribute your app to devices without going through the Play Store review\nprocess.\n\n### Allow unknown sources\n\nOn Android Auto, there is a [developer option](#developer-mode) to enable\nrunning apps not installed from a trusted source. This setting applies to\n[media](/training/cars/media), [messaging notifications](/training/cars/communication/notification-messaging), and\n[parked](/training/cars/parked) apps but doesn't apply to apps built using the [Android for Cars App Library](/training/cars/apps).\n\n\u003cbr /\u003e\n\nEnable Android Auto developer mode\n----------------------------------\n\nIn addition to the [Android developer options](/studio/debug/dev-options)\n(usable on both Android Auto and Android Automotive OS), Android Auto has its\nown developer mode that can be used to improve the development experience. To\nenable it, follow these steps:\n\n1. Open the Android Auto settings.\n\n - Android 10 or higher: on the device, tap **Settings \\\u003e Apps \\&\n notifications \\\u003e See all apps \\\u003e Android Auto \\\u003e Advanced \\\u003e Additional\n settings in the app**.\n - Android 9 or lower: in the Android Auto app, tap the menu, then tap **Settings**.\n2. Scroll to the **About** section near the bottom and tap **Version** to\n display the version and permission information.\n\n3. Tap the **Version and permission info** section 10 times.\n\n The **Allow development settings?** dialog appears.\n4. Tap **OK**.\n\n Developer mode is now enabled, and you can access developer options in the\n overflow menu. You only need to enable developer mode once. To quit developer\n mode, use the option from the drop-down menu in the app bar.\n\nAdditional testing requirements for media apps\n----------------------------------------------\n\nIf you are testing a [media app](/training/cars#media), test for the scenarios\nthat are covered in this section in addition to testing your app on Android\nAuto, Android Automotive OS, or both.\n\n### Test MediaBrowserService startup scenarios\n\nTo help keep drivers and passengers safe, users have additional restrictions on\nhow they can interact with apps while driving. For this reason, Android Auto and\nAndroid Automotive OS have some [`MediaBrowserService`](/reference/androidx/media/MediaBrowserServiceCompat)\nstartup scenarios that your app must be able to handle so that users can\ncontinue to enjoy your content while they're on the road.\n\nTest your app to make sure it can handle each of the following scenarios:\n\n- The `MediaBrowserService` is run before any `Activity` is opened.\n- The `MediaBrowserService` is run when no `Activity` can be shown.\n- The `MediaBrowserService` is run when the user is not signed in.\n\nWhile testing for these scenarios, be sure to try the following methods:\n\n- Force stop the media app, then launch Android Auto or Android Automotive OS.\n- Clear the media app data, then launch Android Auto or Android Automotive OS.\n\nAlso make sure to [set an appropriate error message](/training/cars/media/errors)\nwhen necessary.\n\n### Use the Media Controller Test app\n\nThe [Media Controller Test](https://github.com/googlesamples/android-media-controller)\napp lets you test the intricacies of media playback on Android and helps\nverify your media session implementation. To get started with this tool, see\n[Using the media controller test app](/guide/topics/media-apps/audio-app/media-controller-test)."]]