如何加速Android仿真?

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

How to speed up Android Emulation?

androidperformanceandroid-emulator

提问by Andrea Ambu

I'm trying to get started with Android development.

我正在尝试开始使用 Android 开发。

I'm using eclipse on Linux and using a Pentium IV @3.2Gh with 1GB of ram. I've just followed the "hello android" howto, with just one sad result: the virtualization is too slow.

我在 Linux 上使用 eclipse,并使用 Pentium IV @3.2Gh 和 1GB 内存。我刚刚遵循了“你好 android”的方法,只有一个可悲的结果:虚拟化太慢了。

It seems that launching the virtual machine hasto be slow, and it will be slow even if I'll use a better computer.

看来,启动虚拟机具有很慢,这将是缓慢的,即使我会用更好的计算机。

With slow I mean it takes almost 10 minutes to see "hello android" and if I change it to "hello world" it takes an other 10 minutes...

慢我的意思是几乎需要 10 分钟才能看到“hello android”,如果我将其更改为“hello world”,则需要另外 10 分钟...

How can I solve it? Is it possible to make eclipse load again my app in the current and runningvirtual machine without opening a new one?

我该如何解决?是否可以在不打开新虚拟机的情况下在当前和正在运行的虚拟机中再次加载我的应用程序?

采纳答案by Erich Douglass

As long as you have a compatible AVD running, it shouldn't try to create a new emulator instance. When you want to re-deploy your app to the emulator, kill the existing one from the Debug perspective, and hit the debug button on the menu bar. It should install and launch the app in the existing instance.

只要您有一个兼容的 AVD 正在运行,它就不应该尝试创建一个新的模拟器实例。当您想将您的应用程序重新部署到模拟器时,从 Debug 角度杀死现有的应用程序,然后点击菜单栏上的调试按钮。它应该在现有实例中安装并启动应用程序。

回答by drhodes

Bumping the amount of ram on a honeycomb AVD from 256M to 1GM resulted in huge speedup. It was taking ~1 minute to $ adb install -r foo.apk; now it take 4 seconds. I think the emulator was going into swap!

将蜂窝 AVD 上的 ram 数量从 256M 增加到 1GM 导致了巨大的加速。$ adb install -r foo.apk 花了大约 1 分钟;现在需要 4 秒。我认为模拟器正在交换!

回答by tobsen

In addition to the other answers: Run the emulator (emulator -avd <avd_name> [-<option> [<value>]] ... [-<qemu args>]) with the option -no-boot-anim. This disables the boot animation during emulator startup.

除了其他答案:emulator -avd <avd_name> [-<option> [<value>]] ... [-<qemu args>]使用选项运行模拟器 ( ) -no-boot-anim。这将在模拟器启动期间禁用启动动画。

回答by rekursiv

If you have a virtual machine open when you start your program, it should automatically select it as the VM to install and rerun the application.

如果您在启动程序时打开了一个虚拟机,它应该会自动选择它作为 VM 来安装和重新运行应用程序。