برای آزمایش برنامه خود در وسایل نقلیه واقعی، باید آن را از یک منبع قابل اعتماد مانند فروشگاه Play نصب کنید، به استثنای یک استثنا که در «اجازه منابع ناشناخته» توضیح داده شده است. میتوانید از اشتراکگذاری برنامه داخلی یا یک آهنگ آزمایشی داخلی برای توزیع برنامه خود در دستگاهها بدون انجام فرآیند بررسی فروشگاه Play استفاده کنید.
علاوه بر گزینههای توسعهدهنده اندروید (قابل استفاده در Android Auto و Android Automotive OS)، Android Auto حالت توسعهدهنده خاص خود را دارد که میتوان از آن برای بهبود تجربه توسعه استفاده کرد. برای فعال کردن آن، مراحل زیر را دنبال کنید:
تنظیمات Android Auto را باز کنید.
Android 10 یا بالاتر: در دستگاه، روی تنظیمات > برنامهها و اعلانها > مشاهده همه برنامهها > Android Auto > پیشرفته > تنظیمات اضافی در برنامه ضربه بزنید.
Android 9 یا پایینتر: در برنامه Android Auto، روی منو، سپس روی تنظیمات ضربه بزنید.
به بخش About در پایین صفحه بروید و روی Version ضربه بزنید تا اطلاعات نسخه و مجوز نمایش داده شود.
10 بار روی بخش اطلاعات نسخه و مجوز ضربه بزنید.
تنظیمات توسعه مجاز باشد؟ گفتگو ظاهر می شود
روی OK ضربه بزنید.
حالت برنامهنویس اکنون فعال است و میتوانید به گزینههای توسعهدهنده در منوی سرریز دسترسی داشته باشید. فقط یک بار باید حالت توسعه دهنده را فعال کنید. برای خروج از حالت توسعه دهنده، از گزینه موجود در منوی کشویی در نوار برنامه استفاده کنید.
الزامات آزمایش اضافی برای برنامه های رسانه
اگر در حال آزمایش یک برنامه رسانه هستید، علاوه بر آزمایش برنامه خود در Android Auto، سیستم عامل Android Automotive یا هر دو، سناریوهایی را که در این بخش پوشش داده شده است، آزمایش کنید.
سناریوهای راه اندازی MediaBrowserService را آزمایش کنید
برای کمک به حفظ ایمنی رانندگان و مسافران، کاربران محدودیتهای بیشتری در مورد نحوه تعامل با برنامهها در حین رانندگی دارند. به همین دلیل، Android Auto و Android Automotive OS دارای سناریوهای راه اندازی MediaBrowserService هستند که برنامه شما باید قادر به مدیریت آنها باشد تا کاربران بتوانند همچنان از محتوای شما لذت ببرند در حالی که در جاده هستند.
برنامه خود را آزمایش کنید تا مطمئن شوید که می تواند هر یک از سناریوهای زیر را مدیریت کند:
MediaBrowserService قبل از باز شدن هر Activity اجرا می شود.
MediaBrowserService زمانی اجرا می شود که هیچ Activity نشان داده نشود.
MediaBrowserService زمانی اجرا می شود که کاربر وارد نشده باشد.
در حین آزمایش برای این سناریوها، مطمئن شوید که روش های زیر را امتحان کنید:
برنامه رسانه را به اجبار متوقف کنید، سپس Android Auto یا Android Automotive OS را راه اندازی کنید.
داده های برنامه رسانه را پاک کنید، سپس Android Auto یا Android Automotive OS را راه اندازی کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-08-18 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 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)."]]