C
Android Emulator Requirements
Running in an emulator
The quickest method for evaluating Qt for Android Automotive is to run the examples on an emulator. Qt cannot provide a pre-built Android Automotive Operating System (AAOS) image, so you will need to build or acquire one yourself.
The options for evaluating the examples are:
- Build the android emulator image with the AOSP platform debug key: the Qt for Android Automotive examples provided as pre-built APKs will then work out of the box.
- Build an AAOS image with a different platform key: you will now have to build and sign the example APKs with the same platform key.
Why build an emulator image?
The example APKs delivered by Qt are signed with an AOSP platform debug key. This is the publicly available key, that anyone can download and use. This enables these examples to run as system apps. This does however mean that to evaluate them you need an Android Automotive API29 or higher image. This image must be built with the same publicly available key or the APKs will not work.
Note: Google does not publicly share pre-built images signed with a platform debug key.
Note: If you are using an AAOS image built with a different platform key, then you need to use that same platform key to sign the APKs once again.
Creating a platform keystore
Here we'll show you how to create a keystore for signing Qt for Android Automotive apps, from Google's publicly available platform certificate in an AOSP source tree.
You can see that certificate in the AOSP source tree here: https://cs.android.com/android/platform/superproject/+/android-12.0.0_r32:build/make/target/product/security/
But in your environment you will find it located in:
<your-AOSP-root>/build/make/target/product/security
On Windows, if you have not done so already you will need to find your own trusted OpenSSL binary and install it.
Here is one such public OpenSSL binary package for Windows, use at your own risk.
Note: A version of OpenSSL is included by default in most Linux distributions.
Run the following commands in the security
folder:
openssl pkcs8 -inform DER -nocrypt -in platform.pk8 -out platform.key openssl pkcs12 -export -in platform.x509.pem -inkey platform.key -name platform -out platform.pem -password pass:password keytool -importkeystore -destkeystore platform.keystore -deststorepass password -srckeystore platform.pem -srcstoretype PKCS12 -srcstorepass password
Remember to change the "password" above.
You should see the following output:
Importing keystore platform.pem to platform.keystore... Entry for alias platform successfully imported. Import command completed: 1 entries successfully imported, 0 entries failed or canceled
Then follow instructions at How to: Signing Android Packages to use Qt Creator to sign your applications so they work on your device running your signed development AOSP image.
Note: The generic dev keys mentioned above will not work on any AOSP image that has been signed with actual, non-dev keys.
See also Launching Android Emulator.
Available under certain Qt licenses.
Find out more.