27 8月 2015
Posted by Josh Gordon, Developer Advocate
Today we’re releasing the Desktop Head Unit (DHU), a new testing tool for Android Auto developers. The DHU enables your workstation to act as an Android Auto head unit that emulates the in-car experience for testing purposes. Once you’ve installed the DHU, you can test your Android Auto apps by connecting your phone and workstation via USB. Your phone will behave as if it’s connected to a car. Your app is displayed on the workstation, the same as it’s displayed on a car.
The DHU runs on your workstation. | Your phone runs the Android Auto companion app. |
Now you can test pre-released versions of your app in a production-like environment, without having to work from your car. With the release of the DHU, the previous simulators are deprecated, but will be supported for a short period prior to being officially removed.
You’ll need an Android phone running Lollipop or higher, with the Android Auto companion app installed. Compile your Auto app and install it on your phone.
Install the DHU on your workstation by opening the SDK Manager and downloading it from Extras > Android Auto Desktop Head Unit emulator.
The DHU will be installed in the <sdk>/extras/google/auto/
directory.
Be sure your phone and workstation are connected via USB.
Start the head unit server in the Android Auto companion app before starting the DHU on your workstation. | You’ll see a notification when the head unit server is running. |
adb forward tcp:5277 tcp:5277
. Don’t forget this step! cd <sdk>/extras/google/auto/
./desktop-head-unit
desktop-head-unit.exe
At this point the DHU will launch on your workstation, and your phone will enter Android Auto mode. Check out the developer guide for more info. We hope you enjoy using the DHU!