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

2024-03-31

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

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

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

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

例如:

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

Etc.

我尝试了三星的在线远程测试实验室,但我发现它的限制太多(似乎无法在某些端口关闭的互联网热点上使用它),启动速度很慢,而且我最终只是看到空白的黑屏。所以,我真的更愿意将我自己的版本作为 AVD 运行。


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

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

按照 mwalter 至步骤 6 的步骤进行操作(以获得合适的皮肤)。然后执行以下操作:

  1. 在 Android 虚拟设备管理器中,单击“设备定义”选项卡,然后按“新设备”

  2. 键入名称“Samsung Galaxy SII”(该名称必须准确,以下文件才能正常工作。如果更改它,请务必对以下文件中的名称进行等效更改。)

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

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

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

  6. 将名称为“Samsung Galaxy SII”的 ... 元素替换为以下内容:

    <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 管理器并返回到设备定义选项卡,选择 Samsung Galaxy SII 设备并选择创建 AVD。将其命名为您认为合适的名称并点击“确定”。 (同样,我们将覆盖它,所以不要太担心设置。)

  8. 关闭 AVD 管理器并在您喜欢的文本编辑器中打开文件 C:\Users\[用户名]\.android\avd\[avd 名称]\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 值是否与原始文件中的值相同。如果不同,该文件将不起作用。

祝你好运。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

三星 Galaxy S II AVD(Android 虚拟设备)基本设置? 的相关文章

随机推荐