Android 加速安卓模拟器

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

Speed up Android emulator

androidwindowsandroid-emulatorqemu

提问by Blaise

I read on many other topics that the Android emulator starts really slow. Indeed, it takes +15 mins to start. However, on my machine is slow even after that.

我在许多其他主题上读到 Android 模拟器启动非常慢。事实上,开始需要+15分钟。但是,即使在那之后,在我的机器上也很慢。

The 'phone' responds with a 3-4 seconds delay and everything has a huge lag.

“电话”响应延迟 3-4 秒,一切都有很大的滞后。

Is there any way to improve the performance of my laptop (Asus 1201N) is too rusty for the Android emulator?

有什么办法可以提高我的笔记本电脑(华硕 1201N)对于安卓模拟器来说太生锈了?

PS: Tried in different emulator resolutions and the result is the same

PS:在不同的模拟器分辨率下试过,结果是一样的

Edit: My laptop has 2 cores with HyperThreading. And it shows as 4 CPU in Device Manager. However, when using the emulator, just one of the graphs is at 100%. Can I do something to make it work multi core?

编辑:我的笔记本电脑有 2 个带超线程的内核。它在设备管理器中显示为 4 CPU。但是,当使用模拟器时,只有一张图是 100%。我可以做些什么让它在多核上工作吗?

采纳答案by Brandon O'Rourke

Do you have "Disable Boot Animation" checked?

您是否选中了“禁用启动动画”?

Also, if that doesn't fix it, one thing that helps is that you never actually have to close the emulator screen while you're coding. If you click debug when it's already open, your APK will get uploaded to the emulator and start pretty much immediately. For some reason it took me a while to figure out that I didn't have to manually close the emulator.

此外,如果这不能解决问题,那么有帮助的一件事是您在编码时实际上不必关闭模拟器屏幕。如果您在已经打开的情况下单击调试,您的 APK 将被上传到模拟器并几乎立即启动。出于某种原因,我花了一段时间才弄清楚我不必手动关闭模拟器。

回答by Ben Burnett

One thing I learned that helped me is that once the emulator is open from your first debug run you DO NOT have to close it. Leave it open, and on your next debug run it will be ready to go without any load up time like when you first open it.

我学到的对我有帮助的一件事是,一旦仿真器从您的第一次调试运行中打开,您就不必关闭它。保持打开状态,在您下次调试运行时,它将准备就绪,无需像您第一次打开时那样加载时间。

In regards to your slowness after startup I suspect it's just your computer. It runs very fast for me. It starts up in about 20 seconds or less, and once it's open my subsequent debugs load very fast.

关于你启动后的缓慢,我怀疑这只是你的电脑。它对我来说运行得非常快。它在大约 20 秒或更短的时间内启动,一旦打开,我的后续调试加载速度就会非常快。

I hope at least my first tip helps to save some of your sanity.

我希望至少我的第一个提示有助于挽救您的一些理智。

回答by Harvey Darvey

Here's what you can try. It does speed up the emulator for me, especially during loading time. I noticed the emulator is only using a single core of the available CPU. What I did is to set it to use all available processors.

这是您可以尝试的方法。它确实为我加速了模拟器,尤其是在加载时间。我注意到模拟器仅使用可用 CPU 的单个内核。我所做的是将其设置为使用所有可用的处理器。

I'm using Windows 7.

我正在使用 Windows 7。

When the android emulator is starting, open up the Task Manager, look under the Process tab, look for "emulator-arm.exe" or "emulator-arm.exe *32" ...right click on it, select Processor Affinity and assign as much processor as you like to the emulator.

当 android 模拟器启动时,打开任务管理器,在进程选项卡下查找,查找“emulator-arm.exe”或“emulator-arm.exe *32”...右键单击它,选择处理器亲和力和为模拟器分配尽可能多的处理器。

enter image description here

在此处输入图片说明

回答by Mainul

I think there is few ways to improve the performance of your Android Emulator like

我认为有几种方法可以提高 Android 模拟器的性能,例如

  1. Use Snapshot, this will improve the boot time for consecutive application running
  2. Use x86 Intel Hardware Accelerator
  3. Use 3rd Party Emulator like BlueStacks
  1. 使用快照,这将提高连续应用程序运行的启动时间
  2. 使用 x86 Intel 硬件加速器
  3. 使用 BlueStacks 等第 3 方模拟器

Hopefully it will help you to improve the performance and resolve your problems. Thanks

希望它能帮助您提高性能并解决您的问题。谢谢

回答by Michael

it is way too slow for me too. (slow on both my Pentium 4 (ubuntu) and my dual core 64 laptop (Windows 7)

对我来说也太慢了。(在我的 Pentium 4 (ubuntu) 和我的双核 64 笔记本电脑(Windows 7)上都很慢

apparently it uses QEMU - could I perhaps look for the image file and try a different version of qemu?

显然它使用 QEMU - 我可以查找图像文件并尝试不同版本的 qemu 吗?

Another thing I tried is this: http://www.android-x86.org/(in vmware) this seems MUCH faster but I can't get it to see the network!

我尝试的另一件事是:http: //www.android-x86.org/(在 vmware 中)这似乎快得多,但我无法让它看到网络!

(right now I just want to test some websites in the brower so seeing the network is a must - I'm not doing native apps just yet)

(现在我只想在浏览器中测试一些网站,因此必须查看网络 - 我还没有做本机应用程序)

回答by Coty Alexander Rothery

I had the same problem and in order to solve it I just disabled all the transition animation effects that are enabled under Spare Parts.

我遇到了同样的问题,为了解决它,我只是禁用了在备件下启用的所有过渡动画效果。

回答by raidfive

I discovered that instead of running the 'Debug' target, I just run the 'Run' target. The emulator runs a lot smoother when doing so. I only jump into debug mode if I really need it.

我发现我没有运行“调试”目标,而是运行“运行”目标。这样做时,模拟器运行得更顺畅。如果我真的需要它,我只会进入调试模式。

回答by Ablert Luzx

To connect to network from android-x86, you neek to manual setup ip manual by use this command in console mode (Alt + F1):

要从 android-x86 连接到网络,您需要在控制台模式 (Alt + F1) 下使用此命令手动设置 ip 手册:

ifconfig eth0 netmask 255.255.255.0 up

ifconfig eth0 网络掩码 255.255.255.0 向上

after do that, you can check it by type : netcfg in console and you can see this ip is set at your local wmware

完成后,您可以在控制台中通过键入:netcfg 来检查它,您可以看到此 ip 设置在您的本地 wmware

you can check it success by ping ip you had been set in command prompt, and after that, you can use adb connect to connect debugger to your virtual android

您可以通过在命令提示符中设置的 ping ip 来检查它是否成功,之后,您可以使用 adb connect 将调试器连接到您的虚拟 android