Android emulator hangs forever at boot time

两盒软妹~` 提交于 2019-12-03 12:26:55

Note: emulator version 26.1.3 is here including interesting fixes. I'm busy to revise it now:

Related issue using emulator 26.1.2 here. Relaunch last build like me to use 26.1.3 or install locally

My answer is not exact solution to your problem but use Genymotion for simulation. It offers many devices from different brands and more robust AVDs. I only use AVD in Android Studio when i'm to test sensors virtually. That emulator is still cumbersome and very problematic.

I've got this problem when I use hardware accelerated image. The solution that works for me, and may work for you is to create a new Virtual Device, and select "Software" under "Emulated Performance":

I've had this a number of times when the emulator gets updated.

The only solution I've found, if you can it a solution, is to delete the emulator and re-create it again and it should work OK after that.

emulator: MemoryReport: Epoch: 140737476643856, Res/ResMax/Virt/VirtMax: 737525760 737525760 5164826624 5302894592

Explanation:

Epoch: 140737476643856 /* this millisecond values gives when you created this emulator*/

Res/ResMax/Virt/VirtMax

Res - Resource memory used by a process (booting process). Since your booting process is using your total RAM (emulator's RAM), it is being kind of hang.

ResMax - Resource memory denotes the total actual RAM memory of your emulator.

Virt - Virtual Memory used by a process. It is swap memory.

VirtMax - The maximum Virtual Memory available in the emulator.

/*Note: Since the booting process has not used your total virtual memory, so your emulator is still running. But since all the RAM is full, the processing is happening, but it can't go further. So, it keeps showing "Android" in the screen.

I have these solutions based on order (the best is the top most).

1) Please increase your RAM memory of your emulator. Note: you should have more RAM on your laptop. You have to check your host machine's RAM use as well.

2) If your host machine (laptop) doesn't have more RAM, then you might want to find alternative emulator like GenyMotion, BlueStacks which takes less memory than Android Emulator.

GenyMotion: https://www.genymotion.com/

BlueStack: http://www.bluestacks.com/

Here is the picture how you can increase your RAM size in your emulator.

Open ADV > Edit > Show Advanced Settings > Below Screen appears > Increase RAM

Note: VM Heap size has nothing to do with your problem. Each apps is a separate Dalvik Virtual Machine instance. VM heap gives how much RAM you can, at max, assign for each app.

Note: This problem is not related to your Graphics. It is the boot-time hang problem. So, Emulated performance based on Software or Hardware shouldn't be the answer.

I had the same problem while using the Android-SDK emulators. This solution works, assuming you have an Android build environment; in my case, AOSP. In this instance, the emulator which caused the same problem that OP and others have was emulator64-arm, from the SDK. When I tried the AOSP/prebuilts emulator64-arm, it worked just fine. The regular AOSP emulator worked as well, and you can use them with AVDs as well. Hope this helps, good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!