Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Android AVD take so long to start up?

I got the Hello, Android program to work after reading the tutorials from Google's developer website, but it takes SO long for the AVD to load up! Plus, in the console section in the bottom part of Eclipse, two of the lines were written in red, which I'm guessing is bad. It takes around a minute for the AVD to start running the actual program. This is what the console printout looks like:

[2010-08-06 12:32:38 - HelloAndroid] ------------------------------
[2010-08-06 12:32:38 - HelloAndroid] Android Launch!
[2010-08-06 12:32:38 - HelloAndroid] adb is running normally.
[2010-08-06 12:32:38 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-08-06 12:32:38 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
[2010-08-06 12:32:38 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
[2010-08-06 12:32:54 - HelloAndroid] New emulator found: emulator-5554
[2010-08-06 12:32:54 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2010-08-06 12:34:05 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-08-06 12:34:05 - HelloAndroid] Device API version is 8 (Android 2.2)
[2010-08-06 12:34:05 - HelloAndroid] HOME is up on device 'emulator-5554'
[2010-08-06 12:34:05 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'
[2010-08-06 12:34:05 - HelloAndroid] Installing HelloAndroid.apk...
[2010-08-06 12:35:07 - HelloAndroid] Success!
[2010-08-06 12:35:07 - HelloAndroid] Starting activity com.example.helloandroid.HelloAndroid on device 
[2010-08-06 12:35:11 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloandroid/.HelloAndroid }

Now that I looked at the times, I started to run the program at 12:32, and it finally had my program on the screen at 12:35, so thats 3 minutes. Is this a normal amount of time I have to wait? If it isn't, how to make it faster?

like image 598
Pat Avatar asked Aug 06 '10 16:08

Pat


People also ask

Why does emulator take so long to start?

Google emulator uses ARM opcode, a kind of machine language. It must convert from ARM opcode to Intel opcode. That's why it's slow.

How do you make AVD faster?

Go to the Android SDK root folder and navigate to extras\intel\Hardware_Accelerated_Execution_Manager. Execute file IntelHaxm.exe to install. (in Android Studio you can navigate to: Settings -> Android SDK -> SDK Tools -> Intel x86 Emulator Accelerator (HAXM installer)) Create AVD with "Intel atom x86" CPU/ABI.

Why is AVD emulator so slow?

The Android Emulator is very slow. The main reason is because it is emulating the ARM CPU & GPU, unlike the iOS Simulator, which runs x86 code instead of the ARM code that runs on the actual hardware.

How long does Android Emulator take to start?

For me the emulator takes 5 minutes to start, and I find it normal. I try to develop on Netbook. Starting the emulator takes incredibelly long.


1 Answers

Well the AVD is a totally different architecture from say a Windows PC. Windows usually runs on 32bit or 64bit. On Intel or AMD processors. The Instructions for the processor are written in x86. The way binary and machine code works/runs is different to each arcitechture. The android package that you have uploaded onto the device has to be compiled on the AVD architechture. The Emulator has to emaulate ARM architechture so the instruction sent to the CPU is different. This takes time to compile this code. Hope this answers it. Any questions?

like image 52
Luke Avatar answered Sep 28 '22 21:09

Luke