开发者

Android AVD won't start

开发者 https://www.devze.com 2023-02-22 06:06 出处:网络
When I try to start an AVD from the android tool, all I see is just a big black screen with \"ANDROID\" written on it. Nothing开发者_StackOverflow happens. What could be the problem?Wow, turns out it\

When I try to start an AVD from the android tool, all I see is just a big black screen with "ANDROID" written on it. Nothing开发者_StackOverflow happens. What could be the problem?


Wow, turns out it's just taking forever to load. Question closed :-)


If you want to know if the AVD emulator is hanging or just taking it's sweet time, then look at the Console and LogCat views in Eclipse. When your app is up in the emulator you should see lines in LogCat that says

04-04 16:49:51.475: INFO/ActivityManager(58): Displayed activity Your_packagename/.Your_App Name: 1191 ms (total 30764 ms)
04-04 16:49:51.475: INFO/ActivityManager(58): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 30766 ms (total 30766 ms)

And the Console will generally say

[2011-04-04 16:48:58 - YourApp] ------------------------------
[2011-04-04 16:48:58 - YourApp] Android Launch!
[2011-04-04 16:48:58 - YourApp] adb is running normally.
[2011-04-04 16:48:58 - YourApp] Performing your application here activity launch
[2011-04-04 16:48:58 - YourApp] Automatic Target Mode: launching new emulator with compatible AVD 'AVD_2.2_L8'
[2011-04-04 16:48:58 - YourApp] Launching a new emulator with Virtual Device 'AVD_2.2_L8'
[2011-04-04 16:48:59 - YourApp] New emulator found: emulator-5554
[2011-04-04 16:48:59 - YourApp] Waiting for HOME ('android.process.acore') to be launched...
[2011-04-04 16:49:20 - YourApp] HOME is up on device 'emulator-5554'
[2011-04-04 16:49:20 - YourApp] Uploading YourApp.apk onto device 'emulator-5554'
[2011-04-04 16:49:20 - YourApp] Installing YourApp.apk...
[2011-04-04 16:49:48 - YourApp] Success!
[2011-04-04 16:49:48 - YourApp] Starting activity your_application on device emulator-5554
[2011-04-04 16:49:50 - YourApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=your_package/.your_app }

If you don't get to the end of these statements in their respective consoles in a minute or so, then your emulator has probably frozen.


If you don't have Intel's HAXM installed, but try to use it Android Studio will just wait for the emulator to start forever and you won't see the error message. Start the emulator from the command line to see any error messages:

C:\Users\.....\android-sdk\tools\emulator.exe -avd Nexus_4_API_21 -netspeed full -netdelay none


In my case, the reason was low system memory. When I closed some high memory consuming apps, AVD started successfully.


For me, I needed to chown the kvm dir: chown -R $USER /dev/kvm. Android Studio had an error message for this, but it was too small to notice.

0

精彩评论

暂无评论...
验证码 换一张
取 消