eclipse 如何制作具有 > 768MB RAM 的 AVD 来模拟 Galaxy 设备

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16868663/
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-09-19 20:39:22  来源:igfitidea点击:

How to make an AVD with > 768MB RAM To emulate Galaxy devices

eclipseandroid-emulatorgalaxy

提问by Sinthia V

I am trying to emulate the Galaxy Note 2 which contains 2GiB RAM and some custom hardware like the s-pen and TouchWiz. I created an emulator with 2GB to start with. The emulator won't launch, in fact it is crashing eclipse. I would also like to emulate multi-screen TouchWiz support. I don't see any info anywhere on emulating custom platforms like TouchWiz. Any ideas? I need a decent testing platform for the Galaxy series, but I can't even get basic android working.

我正在尝试模拟包含 2GiB RAM 和一些自定义硬件(如 s-pen 和 TouchWiz)的 Galaxy Note 2。我创建了一个 2GB 的模拟器。模拟器不会启动,实际上它正在使 eclipse 崩溃。我还想模拟多屏 TouchWiz 支持。我在任何地方都没有看到任何关于模拟 TouchWiz 等自定义平台的信息。有任何想法吗?我需要一个像样的 Galaxy 系列测试平台,但我什至无法让基本的 android 工作。

edit: The Samsung dev page shows this setup: http://developer.samsung.com/forum/thread/emulator-size-for-galaxy-note-2-/77/178557

编辑:三星开发页面显示此设置:http: //developer.samsung.com/forum/thread/emulator-size-for-galaxy-note-2-/77/178557

Is this a lack of available ram?

这是缺少可用内存吗?

回答by Annihlator

using the suggestion of manually adding "mb" behind the memory size in your configuration file (as suggested in this thread: Android: failed to allocate memory) (located at: %USERPROFILE%/.android/avd/name-of-your-avd/config.ini) has solved the 768mb problem here!

使用在配置文件中的内存大小后面手动添加“mb”的建议(如该线程中的建议:Android:无法分配内存)(位于:%USERPROFILE%/.android/avd/name-of-your- avd/config.ini) 已经解决了这里的 768mb 问题!

example that now works on my win7 x64 ultimate os -with- dedicated gpu;

现在适用于我的带有专用 GPU 的 win7 x64 终极操作系统的示例;

avd.ini.encoding=ISO-8859-1
hw.sdCard=no
hw.device.manufacturer=Google
hw.mainKeys=no
hw.lcd.density=320
hw.accelerometer=yes
hw.dPad=no
hw.cpu.arch=x86
skin.name=720x1280
abi.type=x86
hw.device.hash=1197498893
hw.trackBall=no
hw.device.name=Galaxy Nexus
hw.camera.back=none
hw.sensors.proximity=yes
hw.battery=yes
disk.dataPartition.size=512M
hw.gpu.enabled=yes
image.sysdir.1=system-images\android-18\x86\
hw.audioInput=yes
hw.sensors.orientation=yes
hw.camera.front=none
hw.gps=yes
skin.dynamic=yes
skin.path=720x1280
hw.keyboard=yes
vm.heapSize=128
hw.ramSize=2048mb

I have tested this on two machines, my desktop and laptop both running Windows 7 X64 Ultimate

我已经在两台机器上测试过这个,我的台式机和笔记本电脑都运行 Windows 7 X64 Ultimate

The Laptop has an Intel I7-4702MQ with 12GB ram and GeForce GTX765M The Desktop has an Intel I7-3820 with 32GB ram and has Ati 6950 in Crossfire and an Nvidia GTX560Ti (normally for physx).

笔记本电脑配备 12GB 内存的英特尔 I7-4702MQ 和 GeForce GTX765M 台式机配备配备 32GB 内存的英特尔 I7-3820 和 Crossfire 中的 Ati 6950 和 Nvidia GTX560Ti(通常用于 physx)。

The desktop only has issues in reliably starting the gpu acceleration while using crossfire, other then that i've had no issues with the emulator at all and even managed to assign 4096mb RAM with a 256VM Heap (however increasing the VM-heap above 128 seems to slowdown emulator initiation tremendously here)

桌面只有在使用交火时可靠地启动 gpu 加速方面存在问题,除此之外,我对模拟器完全没有问题,甚至设法为 256VM 堆分配了 4096mb RAM(但是将 VM 堆增加到 128 以上似乎在这里极大地减慢模拟器启动速度)

On the desktop i also tested the 4096MB setup while even using a RAMDISK but this didn't increase performance too much.

在台式机上,我还测试了 4096MB 设置,同时甚至使用了 RAMDISK,但这并没有增加太多性能。

Best settings overall (in my experience) in startup and responsiveness after just a few tests; 2048 with 128mb VM Heap size, gpu acceleration enabled.

经过几次测试后,启动和响应方面的整体最佳设置(根据我的经验);2048 与 128mb VM 堆大小,启用 GPU 加速。

Hope this helps out others!

希望这对其他人有帮助!

回答by Jamieson Pryor

I actually had a similar problem when running on Windows 7. When I relaunched Android studio with administrator privileges it worked. Otherwise I couldn't even open the AVD manager.

实际上,我在 Windows 7 上运行时遇到了类似的问题。当我以管理员权限重新启动 Android Studio 时,它起作用了。否则我什至无法打开 AVD 管理器。

回答by Tom Pace

This question may be a duplicate of:

这个问题可能与以下问题重复:

Android: failed to allocate memory

Android:无法分配内存

I don't presume you would NOT do this, but I'm just going to say it anyway... Check the details of the correct answer, but especially check the comments for the correct answer.

我不认为你不会这样做,但无论如何我只是要说......检查正确答案的详细信息,但特别检查正确答案的评论。

Seriously, I hope this helps. Android and Eclipse issues have been a problem for me in the past until I learned to crush them with a Zen-like attitude and much exhaustive research and trial-and-error.

说真的,我希望这会有所帮助。过去,Android 和 Eclipse 问题一直困扰着我,直到我学会了以禅宗般的态度和详尽的研究和反复试验来粉碎它们。