三星 Galaxy S II AVD(Android 虚拟设备)基本设置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10641744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:28:53  来源:igfitidea点击:

Samsung Galaxy S II AVD (Android Virtual Device) Basic Settings?

androidavdgalaxy

提问by Frank Stallone

I would like to create an AVD of the Samsung Galaxy S II. The sole purpose is to test websites with it's default web browser to see how they look in both portrait and landscape mode.

我想创建三星 Galaxy S II 的 AVD。唯一的目的是使用默认的 Web 浏览器测试网站,以查看它们在纵向和横向模式下的外观。

As it's now the most popular Android smartphone, I'd like to test it with my websites.

由于它现在是最受欢迎的 Android 智能手机,因此我想在我的网站上对其进行测试。

I would just like to know the most basic settings so I can get at least a rough idea. I'm using the Andriod SDK with the GUI frontend.

我只想知道最基本的设置,这样我至少可以得到一个粗略的想法。我正在使用带有 GUI 前端的 Andriod SDK。

I'm looking for those settings that come up after you click "New" in the Andriod Virtual Device Manager.

我正在寻找在您单击 Andriod 虚拟设备管理器中的“新建”后出现的那些设置。

For example:

例如:

Target: SD Card: Skin: Hardware: Abstracted LCD Density Max VM application heap size Device RAM size

目标:SD 卡:皮肤:硬件:抽象 LCD 密度最大 VM 应用程序堆大小设备 RAM 大小

Etc.

等等。

I tried Samsung's online remote test lab but I've found that too restrictive (can't seem to use it at Internet hotspots that have certain ports closed), slow to start and I just end up with blank black screens anyway. So, I'd really prefer to just run my own version as an AVD.

我尝试了三星的在线远程测试实验室,但我发现它太严格了(似乎无法在某些端口关闭的互联网热点上使用它),启动缓慢,无论如何我最终都会出现空白的黑屏。所以,我真的更喜欢将我自己的版本作为 AVD 运行。

回答by Lloyd

The interface to the AVD manager has changed. So there are changes needed to the process. Rather than a single file, there's now both a device definition and a virtual device definition. Unfortunately, the UI doesn't give full control over the contents of either.

AVD 管理器的界面已更改。因此,需要对流程进行更改。现在有一个设备定义和一个虚拟设备定义,而不是单个文件。不幸的是,用户界面不能完全控制两者的内容。

These instructions work with the Android SDK Tools revision 21. They make reference to Windows 7 paths. If you're using a different OS, you'll need to figure out where the files live.

这些说明适用于 Android SDK 工具修订版 21。它们引用了 Windows 7 路径。如果您使用不同的操作系统,则需要弄清楚文件所在的位置。

Follow the steps from mwalter up to step 6 (to get the appropriate skins). Then do the following:

按照从 mwalter 到第 6 步的步骤(以获得适当的皮肤)。然后执行以下操作:

  1. Within the Android Virtual Device Manager, click on the Device Definitions tab and press "New Device"

  2. Type the name "Samsung Galaxy SII" (the name must be exact for the following files to work. If you change it, be sure to make the equivalent changes to the names in the following files.)

  3. Fill in the screen size, resolution and RAM. We're going to override the contents, so values don't really matter, but correct ones are: Screen Size: 4.3 Resolution: 480 x 800 RAM: 1024 Density: hdpi Buttons: Hardware

  4. Hit Create Device, then close the AVD Manager

  5. Open the file C:\Users\[user name]\.android\devices.xml in your favorite XML editor

  6. Replace the <d:device>...</d:device> element having the name "Samsung Galaxy SII" with the following:

    <d:device>
      <d:name>Samsung Galaxy SII</d:name>
      <d:manufacturer>Samsung</d:manufacturer>
      <d:meta/>
      <d:hardware>
        <d:screen>
          <d:screen-size>normal</d:screen-size>
          <d:diagonal-length>4.30</d:diagonal-length>
          <d:pixel-density>hdpi</d:pixel-density>
          <d:screen-ratio>long</d:screen-ratio>
          <d:dimensions>
            <d:x-dimension>480</d:x-dimension>
            <d:y-dimension>800</d:y-dimension>
          </d:dimensions>
          <d:xdpi>216.97</d:xdpi>
          <d:ydpi>216.97</d:ydpi>
          <d:touch>
            <d:multitouch>jazz-hands</d:multitouch>
            <d:mechanism>finger</d:mechanism>
            <d:screen-type>capacitive</d:screen-type>
          </d:touch>
        </d:screen>
        <d:networking>
          Bluetooth
          <!--NFC (put this back in if you have an S2 model that supports NFC-->
          Wifi
        </d:networking>
        <d:sensors>
          Compass
          Accelerometer
          GPS
          ProximitySensor
          LightSensor
          Gyroscope
        </d:sensors>
        <d:mic>true</d:mic>
        <d:camera>
          <d:location>back</d:location>
          <d:autofocus>true</d:autofocus>
          <d:flash>true</d:flash>
        </d:camera>
        <d:keyboard>nokeys</d:keyboard>
        <d:nav>nonav</d:nav>
        <d:ram unit="GiB">1</d:ram>
        <d:buttons>hard</d:buttons>
        <d:internal-storage unit="GiB">16</d:internal-storage>
        <d:removable-storage unit="GiB">32</d:removable-storage>
        <d:cpu>Generic CPU</d:cpu>
        <d:gpu>Generic GPU</d:gpu>
        <d:abi>
          armeabi-v7a
          armeabi
        </d:abi>
        <d:dock/>
        <d:power-type>battery</d:power-type>
      </d:hardware>
      <d:software>
        <d:api-level>10-</d:api-level>
        <d:live-wallpaper-support>true</d:live-wallpaper-support>
        <d:bluetooth-profiles>
          HSP
          HFP
          A2DP
          AVRCP
          OPP
          PBAP
          HID
        </d:bluetooth-profiles>
        <d:gl-version>2.0</d:gl-version>
        <d:gl-extensions>
          <!-- No clue why the tool is unhappy declaring these, but it is.  (Doesn't complain about their presence in the 'official' devices.)  Comment them out for now.
          GL_OES_rgb8_rgba8
          GL_OES_depth24
          GL_OES_vertex_half_float
          GL_OES_texture_float
          GL_OES_texture_half_float
          GL_OES_element_index_uint
          GL_OES_mapbuffer
          GL_OES_fragment_precision_high
          GL_OES_compressed_ETC1_RGB8_texture
          GL_OES_EGL_image
          GL_OES_EGL_image_external
          GL_OES_required_internalformat
          GL_OES_depth_texture
          GL_OES_get_program_binary
          GL_OES_packed_depth_stencil
          GL_OES_standard_derivatives
          GL_OES_vertex_array_object
          GL_OES_egl_sync
          GL_EXT_multi_draw_arrays
          GL_EXT_texture_format_BGRA8888
          GL_EXT_discard_framebuffer
          GL_EXT_shader_texture_lod
          GL_IMG_shader_binary
          GL_IMG_texture_compression_pvrtc
          GL_IMG_texture_npot
          GL_IMG_texture_format_BGRA8888
          GL_IMG_read_format
          GL_IMG_program_binary
          GL_IMG_multisampled_render_to_texture
          -->
        </d:gl-extensions>
        <d:status-bar>true</d:status-bar>
      </d:software>
      <d:state default="true" name="Portrait">
        <d:description>The device in portrait orientation</d:description>
        <d:screen-orientation>port</d:screen-orientation>
        <d:keyboard-state>keyssoft</d:keyboard-state>
        <d:nav-state>nonav</d:nav-state>
      </d:state>
      <d:state name="Landscape">
        <d:description>The device in landscape orientation</d:description>
        <d:screen-orientation>land</d:screen-orientation>
        <d:keyboard-state>keyssoft</d:keyboard-state>
        <d:nav-state>nonav</d:nav-state>
      </d:state>
    </d:device>
    
  7. Re-open the AVD Manager and go back to the Device Definitions tab, select the Samsung Galaxy SII device and select Create AVD. Name it as you see fit and hit "ok". (Again, we're going to override this, so don't worry about the settings too much.)

  8. Close the AVD Manager and open the file C:\Users\[user name]\.android\avd\[avd name]\config.ini in your favorite text editor

  9. Replace the contents of the file with the following:

    avd.ini.encoding=ISO-8859-1
    abi.type=armeabi
    hw.accelerometer=yes
    hw.audioInput=yes
    hw.battery=yes
    hw.cpu.arch=arm
    hw.device.hash=-1902399403
    hw.device.manufacturer=Samsung
    hw.device.name=Samsung Galaxy SII
    hw.dPad=no
    hw.gps=yes
    hw.gsmModem=yes
    hw.keyboard=no
    hw.lcd.density=240
    hw.mainKeys=yes
    hw.ramSize=1024M
    hw.sdCard=yes
    hw.sensors.orientation=yes
    hw.sensors.proximity=yes
    hw.touchScreen=yes
    hw.trackBall=no
    image.sysdir.1=platforms\android-10\images\
    skin.dynamic=yes
    skin.name=galaxy_s2
    skin.path=platforms\android-10\skins\GALAXY_S2
    vm.heapSize=32
    disk.dataPartition.size=2G
    hw.camera.back=webcam0
    sdcard.size=200M
    
  10. You may want to edit the last 3 entries to change how much storage is available and how/whether the camera is changed. I've found that if I make the disk.dataPartition.size as big as it ought to be (16G), the simulator doesn't start properly. The same for sdcard.size, which can be as big as 32G. The hw.camera.back can be set to "None" or "Emulated" if you prefer. As well, check that the hw.device.hash value is the same as in the original file. If it's different, the file won't work.

  1. 在 Android Virtual Device Manager 中,单击 Device Definitions 选项卡,然后按“New Device”

  2. 键入名称“Samsung Galaxy SII”(该名称必须与以下文件完全相同。如果您更改它,请务必对以下文件中的名称进行等效更改。)

  3. 填写屏幕尺寸、分辨率和内存。我们将覆盖内容,因此值并不重要,但正确的值是: 屏幕尺寸:4.3 分辨率:480 x 800 内存:1024 密度:hdpi 按钮:硬件

  4. 点击创建设备,然后关闭 AVD 管理器

  5. 在您喜欢的 XML 编辑器中打开文件 C:\Users\[用户名]\.android\devices.xml

  6. 将名为“Samsung Galaxy SII”的 <d:device>...</d:device> 元素替换为以下内容:

    <d:device>
      <d:name>Samsung Galaxy SII</d:name>
      <d:manufacturer>Samsung</d:manufacturer>
      <d:meta/>
      <d:hardware>
        <d:screen>
          <d:screen-size>normal</d:screen-size>
          <d:diagonal-length>4.30</d:diagonal-length>
          <d:pixel-density>hdpi</d:pixel-density>
          <d:screen-ratio>long</d:screen-ratio>
          <d:dimensions>
            <d:x-dimension>480</d:x-dimension>
            <d:y-dimension>800</d:y-dimension>
          </d:dimensions>
          <d:xdpi>216.97</d:xdpi>
          <d:ydpi>216.97</d:ydpi>
          <d:touch>
            <d:multitouch>jazz-hands</d:multitouch>
            <d:mechanism>finger</d:mechanism>
            <d:screen-type>capacitive</d:screen-type>
          </d:touch>
        </d:screen>
        <d:networking>
          Bluetooth
          <!--NFC (put this back in if you have an S2 model that supports NFC-->
          Wifi
        </d:networking>
        <d:sensors>
          Compass
          Accelerometer
          GPS
          ProximitySensor
          LightSensor
          Gyroscope
        </d:sensors>
        <d:mic>true</d:mic>
        <d:camera>
          <d:location>back</d:location>
          <d:autofocus>true</d:autofocus>
          <d:flash>true</d:flash>
        </d:camera>
        <d:keyboard>nokeys</d:keyboard>
        <d:nav>nonav</d:nav>
        <d:ram unit="GiB">1</d:ram>
        <d:buttons>hard</d:buttons>
        <d:internal-storage unit="GiB">16</d:internal-storage>
        <d:removable-storage unit="GiB">32</d:removable-storage>
        <d:cpu>Generic CPU</d:cpu>
        <d:gpu>Generic GPU</d:gpu>
        <d:abi>
          armeabi-v7a
          armeabi
        </d:abi>
        <d:dock/>
        <d:power-type>battery</d:power-type>
      </d:hardware>
      <d:software>
        <d:api-level>10-</d:api-level>
        <d:live-wallpaper-support>true</d:live-wallpaper-support>
        <d:bluetooth-profiles>
          HSP
          HFP
          A2DP
          AVRCP
          OPP
          PBAP
          HID
        </d:bluetooth-profiles>
        <d:gl-version>2.0</d:gl-version>
        <d:gl-extensions>
          <!-- No clue why the tool is unhappy declaring these, but it is.  (Doesn't complain about their presence in the 'official' devices.)  Comment them out for now.
          GL_OES_rgb8_rgba8
          GL_OES_depth24
          GL_OES_vertex_half_float
          GL_OES_texture_float
          GL_OES_texture_half_float
          GL_OES_element_index_uint
          GL_OES_mapbuffer
          GL_OES_fragment_precision_high
          GL_OES_compressed_ETC1_RGB8_texture
          GL_OES_EGL_image
          GL_OES_EGL_image_external
          GL_OES_required_internalformat
          GL_OES_depth_texture
          GL_OES_get_program_binary
          GL_OES_packed_depth_stencil
          GL_OES_standard_derivatives
          GL_OES_vertex_array_object
          GL_OES_egl_sync
          GL_EXT_multi_draw_arrays
          GL_EXT_texture_format_BGRA8888
          GL_EXT_discard_framebuffer
          GL_EXT_shader_texture_lod
          GL_IMG_shader_binary
          GL_IMG_texture_compression_pvrtc
          GL_IMG_texture_npot
          GL_IMG_texture_format_BGRA8888
          GL_IMG_read_format
          GL_IMG_program_binary
          GL_IMG_multisampled_render_to_texture
          -->
        </d:gl-extensions>
        <d:status-bar>true</d:status-bar>
      </d:software>
      <d:state default="true" name="Portrait">
        <d:description>The device in portrait orientation</d:description>
        <d:screen-orientation>port</d:screen-orientation>
        <d:keyboard-state>keyssoft</d:keyboard-state>
        <d:nav-state>nonav</d:nav-state>
      </d:state>
      <d:state name="Landscape">
        <d:description>The device in landscape orientation</d:description>
        <d:screen-orientation>land</d:screen-orientation>
        <d:keyboard-state>keyssoft</d:keyboard-state>
        <d:nav-state>nonav</d:nav-state>
      </d:state>
    </d:device>
    
  7. 重新打开 AVD 管理器并返回设备定义选项卡,选择三星 Galaxy SII 设备并选择创建 AVD。将其命名为您认为合适的名称并点击“确定”。(同样,我们将覆盖它,所以不要太担心设置。)

  8. 关闭 AVD 管理器并在您喜欢的文本编辑器中打开文件 C:\Users\[user name]\.android\avd\[avd name]\config.ini

  9. 将文件内容替换为以下内容:

    avd.ini.encoding=ISO-8859-1
    abi.type=armeabi
    hw.accelerometer=yes
    hw.audioInput=yes
    hw.battery=yes
    hw.cpu.arch=arm
    hw.device.hash=-1902399403
    hw.device.manufacturer=Samsung
    hw.device.name=Samsung Galaxy SII
    hw.dPad=no
    hw.gps=yes
    hw.gsmModem=yes
    hw.keyboard=no
    hw.lcd.density=240
    hw.mainKeys=yes
    hw.ramSize=1024M
    hw.sdCard=yes
    hw.sensors.orientation=yes
    hw.sensors.proximity=yes
    hw.touchScreen=yes
    hw.trackBall=no
    image.sysdir.1=platforms\android-10\images\
    skin.dynamic=yes
    skin.name=galaxy_s2
    skin.path=platforms\android-10\skins\GALAXY_S2
    vm.heapSize=32
    disk.dataPartition.size=2G
    hw.camera.back=webcam0
    sdcard.size=200M
    
  10. 您可能需要编辑最后 3 个条目以更改可用存储量以及如何/是否更改相机。我发现如果我将 disk.dataPartition.size 设置为应有的大小(16G),模拟器将无法正常启动。sdcard.size 也一样,可以大到 32G。如果您愿意,可以将 hw.camera.back 设置为“无”或“模拟”。同样,检查 hw.device.hash 值是否与原始文件中的值相同。如果不同,则该文件将不起作用。

Good luck.

祝你好运。

回答by mwalter

Do the following to create the Samsung Galaxy S2 skin:

执行以下操作来创建三星 Galaxy S2 皮肤:

  1. Download the skin from the Samsung page (follow the link posted by anshumans)
  2. Go to directory [Android-SDK directory]/platforms/android-10/skins
  3. Create a new directory named GALAXY_S2
  4. Extract all files from the downloaded ZIP file to the new directory
  5. Edit the file manifest.iniand change the line api=9to api=10
  6. Start the AVD and click "New..."
  7. Under Target select "Android 2.3.3 - API Level 10"
  8. Under Skin choose "GALAXY_S2" from the dropdown list
  9. Click "Create AVD"
  1. 从三星页面下载皮肤(按照 anshumans 发布的链接)
  2. 进入目录 [Android-SDK directory]/platforms/android-10/skins
  3. 创建一个名为 GALAXY_S2 的新目录
  4. 将下载的 ZIP 文件中的所有文件解压缩到新目录
  5. 编辑文件manifest.ini并将行更改api=9api=10
  6. 启动 AVD 并单击“新建...”
  7. 在目标下选择“Android 2.3.3 - API Level 10”
  8. 在皮肤下,从下拉列表中选择“GALAXY_S2”
  9. 点击“创建AVD”

As you may have noticed the AVD will be based upon the Android API 10 level. So the Galaxy S2 skin won't show up if you choose the target Android API level 16 for example.

您可能已经注意到 AVD 将基于 Android API 10 级别。因此,例如,如果您选择目标 Android API 级别 16,则不会显示 Galaxy S2 皮肤。

回答by anshumans

Samsung has the S II skin on their developer site here

三星的S II皮肤上的开发者网站点击这里

回答by cainstir

You can download and add the s2 emulator from Samsung's dev site, http://developer.samsung.com/technical-doc/view.do?v=T000000075&pi=1&ps=10&pb=Y&ct=CT350000&sc=

您可以从三星的开发站点下载并添加 s2 模拟器,http://developer.samsung.com/technical-doc/view.do?v=T000000075&pi=1&ps=10&pb=Y&ct=CT350000&sc=

there is also a detailed instruction on how to use them - http://developer.samsung.com/technical-doc/view.do?v=T000000095

还有关于如何使用它们的详细说明 - http://developer.samsung.com/technical-doc/view.do?v=T000000095

回答by Darkseal

While the top-voted answer is correct, you'll most likely end up having a resolution display problem which will hurt almost any App you'll want to test/develop.

虽然最高投票的答案是正确的,但您很可能最终会遇到分辨率显示问题,这会损害您想要测试/开发的几乎所有应用程序。

In order to solve that specific issue you also need to change this settings:

为了解决该特定问题,您还需要更改此设置:

hw.lcd.density

which is located in the hardware.ini of your AVD skin. You can find it here:

它位于 AVD 皮肤的 hardware.ini 中。你可以在这里找到它:

<ANDROID_SDK_PATH>\sdk\platforms\android-<APIversion>\skins\<YourSkin>\hardware.ini

from 300to 218.

300218

回答by Frank

I'm not a big fan of blind copy-and-paste; also, the top answer references a 2nd which, in turn, references a 3rd; finally, there are some new changes in SDK Tools v24.1.2 which mean that absolutely no file editing is requiredif you are not testing BlueTooth. Hence, I thought I'd post an updated and consolidated solution. Full credit to anshumans, mwalter, Lloydand the commenters

我不是盲目复制和粘贴的忠实粉丝。此外,最高答案引用了第二个,而后者又引用了第三个;最后,SDK Tools v24.1.2 中有一些新变化,这意味着如果您不测试蓝牙,绝对不需要文件编辑。因此,我想我会发布一个更新和整合的解决方案。完全归功于anshumans, mwalter, Lloyd和评论者

Paths use Windows conventions. OS X/Linux users can often just switch backslashes (\) to forward slashes (/), except for install folders. These environment variables may or may not be set on your system:

路径使用 Windows 约定。OS X/Linux 用户通常只需将反斜杠 (\) 切换为正斜杠 (/),安装文件夹除外。这些环境变量可能会或可能不会在您的系统上设置:

<ADT_HOME>is the location of AVD Manager.exe(and defaults to C:\Program Files (x86)\Android\android-sdk)

<ADT_HOME>AVD Manager.exe(默认为C:\Program Files (x86)\Android\android-sdk)的位置

<ANDROID_SDK_HOME>is the location of the .androidfolder that AVD uses to store device definitions (and defaults to HOMEPATH[and is unrelated to your SDK's location :)])

<ANDROID_SDK_HOME>.androidAVD 用于存储设备定义的文件夹的位置(默认为HOMEPATH[并且与您的 SDK 的位置无关 :)])



Samsung skins

三星皮肤

Samsung's developer's sitecontains links to a number of skins including the S2; it also has instructions for installing them using Eclipse with the ADT Plugin, which is unnecessary and superseded by Android Studio. To just get the S2 skin, use the link on the Samsung page and then click on the Zip file with a floppy disk symbol (or just click here).

三星的开发者网站包含许多皮肤的链接,包括 S2;它还包含使用带有ADT 插件的Eclipse 安装它们的说明,这是不必要的并且已被Android Studio取代。要获得 S2 皮肤,请使用三星页面上的链接,然后单击带有软盘符号的 Zip 文件(或单击此处)。

If you didn't use Samsung's instructions for installing with Eclipse, the procedure is:

如果您没有使用三星的 Eclipse 安装说明,则步骤是:

  1. Decide which version of Android you are targeting. Note that the S2 was released on API level 9 (Gingerbread) and the skin reflects this. Later releases and updates included API levels 10, 15 and 16. (as per Wikipedia).
  2. Where ??is the target you selected in step 1 above, extract the contents of the downloaded zip file to a new folder (e.g. Galaxy_S2) under

      <ADT_HOME>\platforms\android-??\skins
    
  3. Edit the extracted manifest.ini, changing the line api=9to reflect it's current location (e.g. api=15). (This doesn't actually seem to be necessary, but left in until I can confirm.)
  4. Repeat steps 1-3 for each release you wish to test against.
  1. 确定您要定位的 Android 版本。请注意,S2 是在 API 级别 9(姜饼)上发布的,皮肤反映了这一点。后来的版本和更新包括 API 级别 10、15 和 16。(根据Wikipedia)。
  2. ??您在上面的步骤 1 中选择的目标在哪里,将下载的 zip 文件的内容解压缩到一个新文件夹(例如Galaxy_S2)下

      <ADT_HOME>\platforms\android-??\skins
    
  3. 编辑提取的manifest.ini,更改行api=9以反映其当前位置(例如api=15)。(这实际上似乎没有必要,但在我确认之前留下。)
  4. 对每个要测试的版本重复步骤 1-3。


Device Definition

设备定义

Select the Device Definitionstab on the AVD Manager and then click Create Device...button. On the Create New Device screen,

选择AVD 管理器上的设备定义选项卡,然后单击创建设备...按钮。在创建新设备屏幕上,

  • Accept all defaults except where noted
  • Name: Samsung Galaxy SII (or whatever)
  • Screen Size: 4.3 (or 4.5 for I9210 model)
  • Resolution: 480x800
  • RAM: 1024 MiB (or 1 GiB)
  • Density: hdpi
  • Buttons: Hardware
  • Click on Create Device
  • 接受所有默认值,除非另有说明
  • 名称:Samsung Galaxy SII(或其他)
  • 屏幕尺寸:4.3(或 I9210 型号为 4.5)
  • 分辨率:480x800
  • RAM:1024 MiB(或 1 GiB)
  • 密度:hdpi
  • 按钮:硬件
  • 点击创建设备

<ANDROID_SDK_HOME>\.android\devices.xmlwill get updated with your new device definition.

<ANDROID_SDK_HOME>\.android\devices.xml将使用您的新设备定义进行更新。

As a general rule, unless you are creating a lot of AVDs based on it, you don't ever have tomanually edit entries in devices.xml. Note also that many of edits proposed to match the SII's hardware actually have no net result. If you do wish to edit, first close the AVD Manager (and the Eclipse IDE if applicable).

作为一般规则,除非你创建了很多基于其自动真空淀积的,你永远不要手动编辑的条目devices.xml。另请注意,为匹配 SII 硬件而提议的许多编辑实际上没有最终结果。如果您确实希望进行编辑,请先关闭 AVD 管理器(以及 Eclipse IDE,如果适用)。

  • Find the node for the d:deviceyou just created with <d:name>Samsung Galaxy SII</d:name>

    • d:manufacturer(optional) change value from User to Samsung
    • d:networking(optional) delete/comment out NFC (e.g. <!-- NFC -->) unless you want to test against the rare models that included it
    • d:sensorsdelete Barometer line
    • d:internal-storage(optional) change value from 4 to 16 (or 32), but it is ignored anyways when creating the AVD
    • d:removable-storageno need to add this, as it is ignored
    • d:abino need to pare this, as it is ignored
    • d:bluetooth-profilesreplace self-closing tag with

      <d:bluetooth-profiles>
          HSP
          HFP
          A2DP
          AVRCP
          OPP
          PBAP
          HID
      </d:bluetooth-profiles>
      
    • d:status-barchange value to true

    • d:nav-statechange both entries (under Portrait and Landscape) to 'nonav'
  • 找到d:device您刚刚创建的节点<d:name>Samsung Galaxy SII</d:name>

    • d:manufacturer(可选)将值从用户更改为三星
    • d:networking(可选)删除/注释掉 NFC(例如<!-- NFC -->),除非您想针对包含它的稀有模型进行测试
    • d:sensors删除气压计线
    • d:internal-storage(可选)将值从 4 更改为 16(或 32),但在创建 AVD 时它无论如何都会被忽略
    • d:removable-storage不需要添加这个,因为它被忽略了
    • d:abi不需要削减这个,因为它被忽略了
    • d:bluetooth-profiles将自闭合标签替换为

      <d:bluetooth-profiles>
          HSP
          HFP
          A2DP
          AVRCP
          OPP
          PBAP
          HID
      </d:bluetooth-profiles>
      
    • d:status-bar将值更改为 true

    • d:nav-state将两个条目(在纵向和横向下)更改为“nonav”


Android Virtual Device (AVD) definition (finally)

Android 虚拟设备 (AVD) 定义(最终)

Relaunch the AVD Manager

重新启动 AVD 管理器

  1. Select the Device Definition you just created
  2. Click Create AVD...
  1. 选择您刚刚创建的设备定义
  2. 单击创建 AVD...

or

或者

  1. Click Create...on the Virtual Devices tab
  2. Select the definition you created under Device
  1. 单击虚拟设备选项卡上的创建...
  2. 选择您在设备下创建的定义

then

然后

  1. Accept all defaults unless noted otherwise
  2. AVD Name: AVD_for_Samsung_Galaxy_SII (or whatever)
  3. Device: already set to your device definition's name
  4. Target: choose the appropriate API level- I usually append this to the AVD Name at this point too
  5. CPU/ABI: ARM
  6. Keyboard: Uncheck/Disable 'Hardware keyboard present'
  7. Skin: Galaxy_S2 (if you extracted skin under the chosen target API)
  8. Back Camera: Webcam0 (or whatever; are you interacting with it?)
  9. RAM: Consider lowering to 768 if on Windows
  10. Internal Storage: Although the SII came in 16GB and 32GB varieties, consider leaving at 200MiB.
  11. SD Card Size: leave blank unless it's part of your testing. The larger it is, the more resources required. (Consider 200MiB)
  1. 除非另有说明,否则接受所有默认值
  2. AVD 名称:AVD_for_Samsung_Galaxy_SII(或其他)
  3. 设备:已设置为您的设备定义名称
  4. 目标:选择适当的 API 级别 - 我通常也会在此时将其附加到 AVD 名称
  5. CPU/ABI: ARM
  6. 键盘:取消选中/禁用“硬件键盘存在”
  7. 皮肤:Galaxy_S2(如果您在所选目标 API 下提取皮肤)
  8. 后置摄像头:Webcam0(或其他什么;你在与它互动吗?)
  9. RAM:如果在 Windows 上,请考虑降低到 768
  10. 内部存储:虽然 SII 有 16GB 和 32GB 两种版本,但考虑保留 200MiB。
  11. SD 卡大小:除非它是您测试的一部分,否则请留空。它越大,所需的资源就越多。(考虑 200MiB)

For faster emulation on Windowsconsider disabling HyperV in Windows Features and enabling HAXM. If you do, change the following:

要在 Windows 上进行更快的模拟,请考虑在 Windows 功能中禁用 HyperV 并启用 HAXM。如果这样做,请更改以下内容:

  1. CPU/ABI: Choose any Intel

    Emulation: Check/Enable 'Use Host GPU'

  1. CPU/ABI: 选择任何英特尔

    仿真:检查/启用“使用主机 GPU”

Click OK.

单击确定。

<ANDROID_SDK_HOME>\avd\<AVD_NAME>.avd\config.inireflects all of your settings above (where AVD_NAMEis what you set in 4.). The example given by lloydonly shows one difference where skin.dynamic=yes- I cannot see a difference when running though.

<ANDROID_SDK_HOME>\avd\<AVD_NAME>.avd\config.ini反映了您上面的所有设置(AVD_NAME您在 4. 中设置的内容在哪里)。lloyd给出的例子只显示了一个不同之处skin.dynamic=yes- 虽然我在运行时看不到差异。