Install Google Settings on HAXM x86 emulator (Goog

2019-06-26 02:51发布

问题:

I've gotten a VM accelerated Android emulator (4.2.2, API 17) working using Intel HAXM (on a Mac). I installed the Google Maps SDK using these instructions, which is basically this answer to a previous SO question - Google maps SDK with new Intel Atom x86 emulator - but with pictures.

Therefore, the emulator has access to Google APIs. However, I need to enable location access for Google apps. This is usually done through the Google Settings app, but since the emulator was created targeted to API 17 (not Google APIs 17), Maps and Google Settings are not installed.

Where can I find the .apk for Google Settings in order to install it? It would be even better if there was a way to permanently keep it on the emulator (so that -wipe-data does not delete it).

(I know I need to enable location access because of a problem I was running into earlier. See my previous question here.)

回答1:

There is now a new x86 system image available which has the Google APIs. Install it from the SDK manager - it's under API 19 and called "Google APIs (x86 System Image)". Using an emulator created from that image you should find you have all the Google APIs you could previously only get on ARM system images (I have only tested Maps v2 so far, but it worked).



回答2:

As per Google Android Map Api v2 ypu can't run it on an Android Emulator; you need a real device to test your apps. To run a app which uses Google Maps v2 you need two applications already running on the device

1. Google Play Services (com.google.android.gms.apk)
2. Google Play Store (com.android.vending.apk)

Follow this guide here to download and install the latest version of these two apk's using adb commands.