我可以调整我的 Android 模拟器以使其速度更快吗?

发布于 2024-08-16 04:11:10 字数 83 浏览 8 评论 0原文

我正在使用 android 模拟器来运行我的程序。 但它确实很慢。 启动并显示主屏幕大约需要 90 秒。 我可以调整它,以便大大减少这个时间吗? 谢谢

I am using the android emulator to run my programs.
But its really slow.
It takes around 90 seconds to startup and show the home screen.
Can I tweak it so that I can reduce this time considerably?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

过期情话 2024-08-23 04:11:11

我建议您使用 Genymotion 。它是一个非常快的模拟器(在我的情况下运行不到 10 秒)

它安装了 Google Apps,还包括 Google Play 应用程序,可以下载任何应用程序。对于使用 Maps Api 测试应用程序来说,这是一个很好的功能。

I recommend you to use Genymotion . It's a very fast emulator (less than 10 seconds to run in my case)

It has Google Apps installed also including Google Play App which give the chance to download any app. This is a good feature for testing apps with Maps Api.

梦在深巷 2024-08-23 04:11:11

您需要安装 Intel HAXM

  • 打开 SDK 并安装

输入图像描述这里

  • 创建一个新的 AVD

在此处输入图像描述

  • 现在运行它时你应该得到这个

在此处输入图像描述

如果没有,那么您将需要安装Accelerated Execution Manager

请参阅此运行适用于 Android 的新英特尔模拟器,了解如何执行此操作

< img src="https://i.sstatic.net/9j2C7.png" alt="在此处输入图像描述">

看看您能快多少 视频

You need to install Intel HAXM

  • open you SDK and install

enter image description here

  • Create a new AVD

enter image description here

  • Now when run it you should get this

enter image description here

if not then you will need to install Accelerated Execution Manager

See this Running the new Intel emulator for Android on how can you do this

enter image description here

see how much faster do you get Video

淡淡の花香 2024-08-23 04:11:11

在开发我的游戏 Elastic World 时,我遇到了同样的问题。等待模拟器启动几分钟后,游戏以最高 20 FPS 的速度运行。即使在低端 Android 设备上我也可以轻松获得 60 FPS。

因此,我按照以下网站的说明转移到 VMWare Android 计算机:http://www. android-x86.org/documents/installhowto/

相同的游戏循环现在以 250 FPS 运行。 (这个速度无法玩,我将游戏限制为最大 60 FPS,但超越此限制,它会提供 250 FPS)

While developing my game, Elastic World, I was suffering from the same problem. After waiting minutes for the emulator to startup, the game was running at 20 FPS maximum. Even on low end android devices I could easily get 60 FPS.

So I moved to a VMWare Android machine, following the instructions from this site: http://www.android-x86.org/documents/installhowto/

The same game loop now runs at 250 FPS. (it's not playable at this speed and I have the game limited to max 60 FPS, but overriding this limitation it gives 250 FPS)

夏夜暖风 2024-08-23 04:11:11

尝试为您的模拟器使用较小的分辨率,例如 HVGA。由于使用软件渲染,模拟器需要渲染的像素越多,速度就越慢。

此外,如果您的计算机上有足够的内存,请为模拟器添加至少 1 GB 内存。这是创建 AVD 期间的“设备内存大小”值。

还要为快照设置“启用”标志。这将保存模拟器的状态并使其启动速度更快。

Try to use a smaller resolution for your emulator as for example HVGA. The emulator gets slower the more pixels its needs to render as it is using software rendering.

Also if you have sufficient memory on your computer, add at least 1 GB of memory to your emulator. This is the value "Device ram size" during the creation of the AVD.

Also set the flag "Enabled" for Snapshots. This will save the state of the emulator and let it start much faster.

玩世 2024-08-23 04:11:11

只需在 AVD 管理器中启用“快照”复选框即可。当您关闭 AVD 时,它会保存它的状态。因此,一旦您再次运行模拟器,就会加载保存的状态。因此,AVD 的启动时间将大大缩短。

Just enable "Snapshot" checkbox in your AVD Manager. It will save the state of your AVD when you close it. So, once you run the emulator again, that saved state will be loaded. Hence the boot up time of your AVD will be considerably reduced.

染墨丶若流云 2024-08-23 04:11:11
  1. 首先,我按照这个简介
  2. 使用命令运行仿真:emulator -cpu-delay 0 -no-boot-anim -缓存 ./cache -avd-gpu on (按照链接链接

结果运行速度提高约 2-3 倍

  1. First I follow this introduction
  2. Run emulation with command : emulator -cpu-delay 0 -no-boot-anim -cache ./cache -avd <adv-name> -gpu on (follow link and link)

results is run ~2-3x faster

病毒体 2024-08-23 04:11:10

我遇到了类似的问题(线程此处)。然而,我的需要10-15分钟。考虑到 Android 讨论组中有很多线程,90 秒已经是非常快了。模拟器本质上很慢,我读到的唯一建议是保持模拟器打开,而不是关闭它并重新运行它。但是,正如我的帖子中提到的,如果您有物理 Android 设备,则可以在该设备上运行它。这就是我现在正在做的事情,这是一流的建议。无需漫长的等待时间。如果您没有物理设备,那么我只能建议您不要在代码更改之间关闭模拟器,因为系统会识别更改。

I was having a similar problem (thread here). However, mine was taking 10-15 mins. 90 seconds is blazing fast considering a lot of threads in the Android discussion groups. The emulator is slow by nature and the only recommendation I read was to keep the emulator open instead of closing it and rerunning it. However, as mentioned in my thread, if you have a physical Android device, you can just run it on that. It's what I'm doing at the moment and it was top-notch advice. No long waiting time. If you don't have a physical device, then I can only suggest you don't close the emulator between code changes, as the system will recognise the change.

℉服软 2024-08-23 04:11:10

使用这 3 个选项。

emulator --cpu-delay 0 --no-boot-anim --cache ./cache --avd avd_name

前两个是显而易见的。第三个将使模拟器的内存持久化。你可以将它指向任何不会被启动破坏的文件(/tmp 会发生这种情况),它就像一个永远在线的休眠设备。

use those 3 options.

emulator --cpu-delay 0 --no-boot-anim --cache ./cache --avd avd_name

the first two are obvious. the third one will make the memory of the emulator kind of persistent. you can point it to any file that does not get destroyed by boot (such happens with /tmp) it's like a always-on hibernating device.

暗喜 2024-08-23 04:11:10

如果你绝对不能使用物理Android设备,你可以做的就是在Virtualbox上运行Android操作系统,然后获取模拟Android的IP地址。然后,您可以使用该 IP 地址将 ADB 连接到模拟器。这就是它的要点。我在我的博客上写了关于此方法的更详细指南。 http://www.bobbychanblog.com/2011/07/faster-android -emulator-alternative-using-virtualbox/

If you absolutely cannot use a physical Android device, what you can do is run the Android OS on Virtualbox, and then get the IP address of the emulated Android. Then you'd connect ADB to the emulator using that IP address. That's the jist of it. I've written a more detailed guide to this approach on my blog. http://www.bobbychanblog.com/2011/07/faster-android-emulator-alternative-using-virtualbox/

撩心不撩汉 2024-08-23 04:11:10
  1. -no-boot-anim 参数很好。
  2. 不要关闭模拟器,只需重新启动您的应用程序即可。
  3. 要进一步提高速度,请尝试新的快照功能,此处对此进行了描述。
  1. The -no-boot-anim parameter is good.
  2. Don't turn the emulator off, just re-launch your app.
  3. For further speedups, try the new snapshot feature, which is described here.
难理解 2024-08-23 04:11:10

缩小模拟器的规模使我的模拟器加载速度更快......

emulator -cpu-delay 0 -no-boot-anim -cache ./cache -scale 0.8 -avd avd_name

Scaling the emulator down made my emulator load faster...

emulator -cpu-delay 0 -no-boot-anim -cache ./cache -scale 0.8 -avd avd_name
浅语花开 2024-08-23 04:11:10

实际上这些都是很好的答案,但是你有没有想过将内存从默认的 96mb 更改为 512 之类的?对我有用:)

actually these are all great answers, but have u thought of changing the ram from the default 96mb to something like 512? works for me :)

逆夏时光 2024-08-23 04:11:10

如果您随身携带移动设备,则通过 USB 将其编译到设备会更快(也更可靠)。编译并安装到手机上大约需要 5 秒,我不再使用模拟器了 - 只是速度太慢了。

它不仅速度慢,而且除了静态小部件(动画)之外的任何东西都将难以在模拟器上运行,并且您会注意到滞后。

If you have the mobile device with you, it's much quicker (and more reliable) to compile it via USB to the device. It takes around 5 seconds to compile and install on your phone, I never use the emulator anymore - it's just to slow.

Not only is it slow but anything other than static widgets (animation) will struggle to run on the emulator and you will notice lag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文