Android 慢得无法忍受的安卓模拟器——有解决办法吗?

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

Unbearably slow android emulator -- is there a fix?

androidandroid-emulator

提问by D-Nice

I know that the topic was discussed herelast year, but I am hoping that someone has since found a fix. The emulator is simply not working for me anymore. It took 15 minutes or so to load hello world a few days ago, and now I can't get it to load a simple MapsDemo from the api samples no matter how long I wait.

我知道去年在这里讨论过这个话题,但我希望有人找到了解决办法。模拟器根本不再适合我。前几天加载hello world花了15分钟左右,现在无论等多久都无法从api示例中加载一个简单的MapsDemo。

I'm using eclipse with the android plugin (sdk and avd manager). My pc is 2.31 GHz quadcore with 8GB ram and windows 7 x64. Nothing is being logged in LogCat apparently.

我将 eclipse 与 android 插件(sdk 和 avd 管理器)一起使用。我的电脑是 2.31 GHz 四核,8GB 内存和 Windows 7 x64。LogCat 中显然没有记录任何内容。

Are there any alternatives or certain fixes I can try before buying a phone? I'd just upgrade my phone to an HTC Incredible and debug from the phone, but Verizon won't have any for at least a month and I'd really like to have my app out by then.

在购买手机之前,我可以尝试其他替代方法或某些修复吗?我只是将我的手机升级到 HTC Incredible 并通过手机进行调试,但 Verizon 至少一个月内不会有任何东西,我真的很想在那时推出我的应用程序。

采纳答案by Al Sutton

Delete all your AVDs & re-install the SDK in a new directory. This should clear out any lurking config settings or AVD based issues which could be causing the slowdown.

删除所有 AVD 并在新目录中重新安装 SDK。这应该会清除任何潜在的配置设置或基于 AVD 的问题,这些问题可能会导致速度变慢。

Also try shutting down any virus/spyware scanner you may have running because you can then see if your AV app is trying to scan the AVD and or SD card images which could slow things down.

还可以尝试关闭您可能正在运行的任何病毒/间谍软件扫描程序,因为您可以查看您的 AV 应用程序是否正在尝试扫描 AVD 和/或 SD 卡图像,这可能会减慢速度。

(btw, I'm running the emulator on a Quad Core Q6600 with 4gb RAM & Win 7 x64 and it starts in less than 1 min, so I doubt it's a compatibility issue).

(顺便说一句,我在带有 4gb RAM 和 Win 7 x64 的四核 Q6600 上运行模拟器,它在不到 1 分钟的时间内启动,所以我怀疑这是一个兼容性问题)。

回答by Rikki

The best advice I've received is to use to target an older platform and a lower resolution. The emulator for Android 1.5 at HVGA is significantly faster to load than 3.1 at tablet resolution.

我收到的最佳建议是用于定位较旧的平台和较低的分辨率。Android 1.5 的 HVGA 模拟器加载速度明显快于平板电脑分辨率的 3.1。

If you are running an emulator for a newer Android version, and want to see what it is doing while loading, you can watch on 'adb logcat'. It at least gives some better feedback than the word "Android" with a light shining across it!

如果您正在为较新的 Android 版本运行模拟器,并想在加载时查看它在做什么,您可以在“adb logcat”上观看。它至少提供了比“Android”这个词更好的反馈,上面有灯光!

回答by WeldFire

I usually start it then after I see the "ANDROID" screen close it and restart it and it works and starts up a lot faster the second time.

我通常在看到“ANDROID”屏幕后启动它并关闭它并重新启动它,它可以工作并且第二次启动得更快。

回答by Balaji

I have started using ubuntu v11 (with dual boot) ,emulator is now starting within 40sec and working without any errors ,which i have encountered in windows 7 and performance is also good.

我已经开始使用 ubuntu v11(带双启动),模拟器现在在 40 秒内启动并且没有任何错误,这是我在 Windows 7 中遇到的并且性能也很好。

回答by Andy

I just had the very same problem today, after I received the advise, to create a 400MiB SD Card on my AVD. I did so, but nothing worked anymore. I waited half an hour for my App to compile, but nothing happened even though the LogCat was still runníng ... So I came in here to find a solution and I did!

在收到建议后,我今天遇到了同样的问题,要在我的 AVD 上创建一个 400MiB 的 SD 卡。我这样做了,但没有任何作用了。我等了半个小时让我的应用程序编译,但即使 LogCat 仍在运行,也没有任何反应......所以我来到这里寻找解决方案,我做到了!

Here`s what speeded the whole thing up again:

这是再次加速整个过程的原因:

  1. I went to the AVD Manager (Window > AVD Manager in Eclipse)
  2. Above the AVDs you can see the path where everything is stored that is created by the machine
  3. So I went to that folder of the path and it was filled with previously compiled stuff
  4. So I deleted it and voila, my App is run within a minute again!
  1. 我去了 AVD 管理器(Eclipse 中的窗口 > AVD 管理器)
  2. 在 AVD 上方,您可以看到机器创建的存储所有内容的路径
  3. 所以我去了那个路径的文件夹,里面装满了以前编译的东西
  4. 所以我删除了它,瞧,我的应用程序在一分钟内再次运行!

P.S. It might be the case, that you won`t find the last folders described in the path, because they are hidden. Just type in that path, and they will be there: The hidden folders looked like this: .android\avd Just type it in manually and erase all that stuff in there.

PS 可能是这样,您找不到路径中描述的最后一个文件夹,因为它们是隐藏的。只需输入该路径,它们就会在那里: 隐藏文件夹看起来像这样: .android\avd 只需手动输入它并删除那里的所有内容。

回答by Favas Kv

Using SDK Manager download and Install Intel x86 Emulator Accelerator(After downloading this SDK Package can find executable file at path "SDK_LOCATION"\extras\intel\Hardware_Accelerated_Execution_ManagerInstall it) and also Intel x86 Atom System Imagepackages. enter image description here

使用 SDK Manager 下载并安装Intel x86 Emulator Accelerator(下载此 SDK 包后可以在路径“SDK_LOCATION”\extras\intel\Hardware_Accelerated_Execution_Manager 中找到可执行文件安装它)以及Intel x86 Atom System Image包。 在此处输入图片说明

enter image description here

在此处输入图片说明

Then create a new AVD with CPU/ABIas Intel Atom(x86), and Check Use GPU Host. Done! enter image description here

然后使用CPU/ABI作为Intel Atom(x86)创建一个新的 AVD ,并选中Use GPU Host。完毕! 在此处输入图片说明