如何使用Google Play服务创建API-15模拟器(命令行) [英] How to create API-15 emulator with Google Play Services (Command Line)

查看:232
本文介绍了如何使用Google Play服务创建API-15模拟器(命令行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序的一个用户在 API Level 15(4.0.4)中特别遇到了某些问题,我想在我的最后重现此问题。我没有 4.0.4 设备,并且我想为此创建和模拟器。我正在运行 Android Studio 2.0-beta6 ,并且 GUI AVD Manager 完全不显示任何 API-15 模拟器图像。

因此,我使用了独立的 SDK manager 来安装 API-15 level x86系统映像,然后如下从命令行创建 AVD

  $ android创建avd -n Api-15-Gnex -t 1 

1 是我机器上的 API-15 目标的ID。但是,这个系统映像显然错过了 Google APIs ,而我的应用依赖于 Google Play服务,而我

如何用 API-15 模拟器> Google API ?最好从命令行,但不一定。

解决方案

感谢来自Raptor的评论。通过独立的SDK管理器,在API-15下,选择 Google APIs 并安装软件包。这为开发环境增加了一个新的目标。

  $ android list targets 
-------- -
id:5或Google Inc.:Google APIs:15
名称:Google API
类型:附加
供应商:Google Inc.
版本:3
描述:Android + Google APIs
基于Android 4.0.3(API等级15)
库:
* com.android.future.usb.accessory(usb .jar)
API附件
* com.google.android.media.effects(effects.jar)
视频特效集合
* com.google.android.maps (maps.jar)
谷歌地图API
皮肤:HVGA,QVGA,WQVGA400,WQVGA432,WSVGA,WVGA800(默认),WVGA854,WXGA720,WXGA800
标签/ ABIs:default / armeabi -v7a

请注意,它是ARM映像,而不是x86。由于硬件加速不适用于小于15的API,因此我认为它不会有问题。

然后使用这个目标创建一个新的AVD。

  $ android创建avd --force -n Api-15-Gnex -t 5 
自动选择单个ABI armeabi-v7a
使用以下硬件配置创建基于Google API(Google Inc.),ARM(armeabi-v7a)处理器,
的AVD'Api-15-Gnex':
hw.lcd.density = 240
hw.ramSize = 512
vm.heapSize = 48

现在,你可以从GUI AVD管理器启动。

One user of my app is facing certain issues specifically on API Level 15 (4.0.4), and I would like to reproduce the issue on my end. I don't have a 4.0.4 device, and I would like to create and emulator for this purpose. I'm running Android Studio 2.0-beta6, and the GUI AVD Manager does not show any API-15 emulator images at all.

So, I have then used the standalone SDK manager to install an API-15 level x86 system image, and then created an AVD from command line as follows.

$ android create avd -n Api-15-Gnex -t 1

Id 1 is the id of the API-15 target on my machine. But, this system image obviously misses the Google APIs in it, and my app depends on Google Play services, and I need them specifically to reproduce the issue.

How can I create API-15 emulator with Google APIs? Preferably from command line, but not necessarily.

解决方案

Thanks to the comment from Raptor. Through stand alone SDK manager, under API-15, select Google APIs and install the package. This adds a new target to the development environment.

$ 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

Note that it is an ARM image, not x86. Since hardware acceleration is not available for APIs less than and including 15, it wont matter, I assume.

Then create a new AVD using this target.

$ 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

Now, you may launch it from the GUI AVD manager.

这篇关于如何使用Google Play服务创建API-15模拟器(命令行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆