How to setup an Automotive Android Emulator
Here’s how to outsmart Android Studio into finally running that Polestar 2 Emulator.
If you’re a developer like me who wants to try out Googles new Automotive OS, you’ll most likely be stuck setting up an emulator. Right? Somehow you can select an Automotive Device Profile but cannot choose a System Image although you just installed one. Sounds familiar? Yeah, I’ve been there too.
So here’s a little guidance for you to finally get going:
I. Get the Polestar System Image
That’s right, we’re gonna use Volvos beautiful Polestar 2 Emulator for which there already is an installation guide on the official homepage https://www.polestar.com/de/developer.
Why we not just stick to it? Because it does not work as described. So we will follow the first part and deviate from it later on.
- In Android Studio, select Tools > SDK Manager.
2. Click the SDK Update Sites tab.
3. Click Add, enter a Name and the following URL, then click OK:
URL: https://developer.polestar.com/sdk/polestar2-sys-img.xml
4. Switch to the SDK Platforms tab and enable the Show Package Details checkbox. Then enable Polestar 2 under Android 9.0 and click OK:
This will download the required system image. So far so good. Next step is to create an Android Virtual Device (AVD). This is where we need to apply our little trick!
II. Create the Android Virtual Device
- Select Tools >AVD Manager and create a new Virtual Device. Select the Automotive category.
- Click on Import Hardware Profiles.
- Now navigate to you SDK path. In a subfolder called system-images you will find the Polestar 2 system image you just downloaded. Find and import a file called devices.xml.
4. The imported profile unexpectedly appears within the Tablet category. Select it and click Next.
5. Click the x86 Images Tab. You should find the Polestar 2 Image selectable. Finish the AVD creation.
6. That’s it. Now go ahead and have fun :)
Let me know if this worked and if not, maybe we can find a solution together. Cheers!