Fra*_*one 41 android android-virtual-device galaxy
我想创建三星Galaxy S II的AVD.唯一的目的是使用它的默认Web浏览器测试网站,以查看它们在纵向和横向模式下的外观.
由于它现在是最受欢迎的Android智能手机,我想用我的网站进行测试.
我想知道最基本的设置,所以我至少可以得到一个粗略的想法.我正在使用带有GUI前端的Andriod SDK.
我正在寻找在Andriod虚拟设备管理器中单击"新建"后出现的那些设置.
例如:
目标:SD卡:外观:硬件:抽象LCD密度最大VM应用程序堆大小设备RAM大小
等等.
我尝试了三星的在线远程测试实验室,但我发现限制太多(似乎无法在某些端口关闭的互联网热点上使用它),启动缓慢,我最后还是以空白黑屏结束.所以,我真的更喜欢将自己的版本作为AVD运行.
小智 53
AVD管理器的界面已更改.因此,该过程需要进行更改.现在既有设备定义又有虚拟设备定义,而不是单个文件.不幸的是,用户界面无法完全控制其中的内容.
这些说明适用于Android SDK Tools修订版21.它们引用了Windows 7路径.如果您使用的是其他操作系统,则需要确定文件的存储位置.
按照从mwalter到步骤6的步骤(以获得适当的皮肤).然后执行以下操作:
在Android虚拟设备管理器中,单击"设备定义"选项卡,然后按"新设备"
键入名称"Samsung Galaxy SII"(该名称必须完全适合以下文件才能使用.如果更改它,请确保对以下文件中的名称进行等效更改.)
填写屏幕大小,分辨率和RAM.我们要覆盖内容,所以值并不重要,但正确的是:屏幕尺寸:4.3分辨率:480 x 800 RAM:1024密度:hdpi按钮:硬件
点击Create Device,然后关闭AVD Manager
在您喜欢的XML编辑器中打开文件C:\ Users\[用户名]\.android\devices.xml
用以下内容替换名称为"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>
Run Code Online (Sandbox Code Playgroud)重新打开AVD Manager并返回"设备定义"选项卡,选择Samsung Galaxy SII设备并选择"创建AVD".根据您的需要命名并点击"确定".(同样,我们将覆盖它,所以不要太担心设置.)
关闭AVD管理器并在您喜欢的文本编辑器中打开文件C:\ Users\[用户名]\.android\avd\[avd name]\config.ini
用以下内容替换文件的内容:
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
Run Code Online (Sandbox Code Playgroud)您可能需要编辑最后3个条目以更改可用存储空间以及相机的更改方式.我发现如果我将disk.dataPartition.size设置为应该是(16G)那么大,那么模拟器就无法正常启动.sdcard.size也是一样,可以大到32G.如果您愿意,可以将hw.camera.back设置为"None"或"Emulated".同样,检查hw.device.hash值是否与原始文件中的值相同.如果不同,该文件将无法正常工作.
祝好运.
mwa*_*ter 32
执行以下操作以创建Samsung Galaxy S2皮肤:
[Android-SDK directory]/platforms/android-10/skins
manifest.ini
并将行更改api=9
为api=10
您可能已经注意到AVD将基于Android API 10级别.因此,如果您选择目标Android API级别16,Galaxy S2皮肤将不会显示.
归档时间: |
|
查看次数: |
75347 次 |
最近记录: |