I am trying for last 2 days but can not find any solution.My emulator screen hangs when trying to run android application with error message in error log as below:
No command output when running: 'am start -n com.ss.hello/com.ss.hello.MainActivity -a
android.intent.action.MAIN -c
Exception stack trace:
com.android.ddmlib.ShellCommandUnresponsiveException
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408)
at com.android.ddmlib.Device.executeShellCommand(Device.java:435)
at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:67)
at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(ActivityLaunchAction.java:109)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1277)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.doLaunchAction(AndroidLaunchController.java:1289)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(AndroidLaunchController.java:1261)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.simpleLaunch(AndroidLaunchController.java:906)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.continueLaunch(AndroidLaunchController.java:748)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:409)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:322)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:238)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Session data:
eclipse.buildId=v22.0.1-685705
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product com.android.ide.eclipse.adt.package.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.android.ide.eclipse.adt.package.product
Console output is :
[2013-06-16 13:51:02 - Hello] ------------------------------
[2013-06-16 13:51:02 - Hello] Android Launch!
[2013-06-16 13:51:02 - Hello] adb is running normally.
[2013-06-16 13:51:02 - Hello] Performing com.ss.hello.MainActivity activity launch
[2013-06-16 13:51:02 - Hello] Automatic Target Mode: Preferred AVD 'MY_AVD' is available on emulator 'emulator-5554'
[2013-06-16 13:51:02 - Hello] Uploading Hello.apk onto device 'emulator-5554'
[2013-06-16 13:51:04 - Hello] Installing Hello.apk...
[2013-06-16 13:51:30 - Hello] Success!
[2013-06-16 13:51:30 - Hello] Starting activity com.ss.hello.MainActivity on device emulator-5554
From this point nothing happens.It just hang on.I wait for 1-2 hr.but nothing happen.Tried to clean project,delete project,check for updates,etc...nothing works.
I am running simplest and small application.It has no error and also i set minimum and target SDK version as 10 and 17 respectively. My AVD's target is 17.
What is solution for this ?
Late to answer but I think this will help..
- First and foremost what is your PC's configuration?? , how much RAM?? b'coz higher the API level you set , more processing time will be taken by emulator..
- If you have good configuration PC, then as mentioned by many, you should Wipe user data from AVD and uncheck load from snapshot and then give this a try..
- Still prob, delete the AVD and recreate...
- Still prob, then try Android x86 instead of armeable simulators. Android x86 are much more faster ..
- Your eclipse is updated as you mentioned then try opting for x86 emulators.. Refer here..
- Try restarting Eclipse as a last resort... :P
Developing an application is generally for a targeted devices, so if possible run and test on real device itself.
Hope this helps...
The startup of the emulator is very slow. The good thing is that you only need to start the emulator once. If the emulator is already running and you run your app again, the emulator reinstalls the app relatively quickly. Of course, if you want to know how fast it will run on a phone, it is best to test it on a real phone.
来源:https://stackoverflow.com/questions/17131524/emulator-screen-hangs-when-trying-to-run-android-application