我的应用的一位用户在API Level 15 (4.0.4)
上特别面临某些问题,我想在我的问题上重现这个问题。我没有4.0.4
设备,我想为此目的创建和模拟器。我正在运行Android Studio 2.0-beta6
,而GUI
AVD Manager
根本没有显示任何API-15
仿真器图像。
因此,我使用独立的SDK manager
来安装API-15
级别的x86系统映像,然后从命令行创建AVD
,如下所示。
$ android create avd -n Api-15-Gnex -t 1
ID 1
是我计算机上API-15
目标的ID。但是,这个系统图像显然错过了它中的Google APIs
,而我的应用程序依赖于Google Play services
,我需要它们才能重现问题。
如何使用API-15
创建Google APIs
模拟器?最好是命令行,但不一定。
答案 0 :(得分:10)
感谢Raptor的评论。通过独立的SDK管理器,在API-15下,选择Google APIs
并安装软件包。这为开发环境添加了新目标。
$ android list targets
----------
id: 5 or "Google Inc.:Google APIs:15"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 4.0.3 (API level 15)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800
Tag/ABIs : default/armeabi-v7a
请注意,它是ARM映像,而不是x86。由于硬件加速不适用于低于15且不包括15的API,因此无关紧要,我认为。
然后使用此目标创建一个新的AVD。
$ android create avd --force -n Api-15-Gnex -t 5
Auto-selecting single ABI armeabi-v7a
Created AVD 'Api-15-Gnex' based on Google APIs (Google Inc.), ARM (armeabi-v7a) processor,
with the following hardware config:
hw.lcd.density=240
hw.ramSize=512
vm.heapSize=48
现在,您可以从GUI AVD管理器启动它。