When I try to debug using one of the configurations that I've set up (for example Android233), the emulator never actually launches. I just see a little green icon in my task bar that says "launching Android233," but it never launches. I've let it sit there for hours and it never does anything. I don't know if this is related, but my emulators don't show in device view in the DDMS perspective. I have a physical Android device, which shows up in device view. My question is, what is happenin' and how can I fix it?
Thanks for taking the time to read my question :)
I thought I had the problem figured out, but it stopped working again. Here's more information: When I run my debug configuration, in the lower right corner of my Ecplipse windows it says:
"Launching MyDebugConfig (100%)" and then there's a green icon next to it.
I looked in task manager and the emulator is not in there. I looked in DDMS and my AVD is not listed and there is nothing in the LogCat or Thread or anything else for that matter. I have my debug configuration set to prompt me to pick a device, but it never does that. It just loads my AVD, even if I have my phone connected (which is visible in DDMS). I'm so stumped. I've had this problem since I started using Eclipse and I don't know what to do.
Thanks.
Go to DDMS Perspective =>Click View menu=>reset adb
If Your genymotion virtual device is not seen in android device monitor then just try this.
1. start android studio
2. start Android Device Monitor
3. Lastly start the genymotion virtual device it will appear
The emulator won't show up in the DDMS section until its running.
The emulator won't lunch probably because you misconfigured it, currently the lunch dialog of the emulator doesn't support error messages, however you can get the lunch stack trace while you try to lunch the emulator via Eclipse.
Disconnect your physical device, run your project and select the emulator. you should see an error message on DDMS console.
If you in Windows try run (after starting emulator)
adb.exe kill-server
adb.exe start-server
and wait for restarting your adb
Related
Is there a way to bring android emulator from offline to online mode without closing AVD?
I tried adb's 'kill-server', 'start-server' commands but this just seems to re-start adb server (adb.exe process), the emulator is still in offline mode and 'adb devices' still show 'offline' state.
Also can someone explain what exactly 'offline' mode of emulator means.
In my case - Emulator (standalone), daemon process and ADB server - all seem to be running. Why is emulator state still offline?
Updating Question:
I have tried 'adb reset' both from Eclipse & command line that does not solve the problem. Issue seems to be more with Emulator Memory. Per my analysis memory of emulator keeps increasing and after a limit (~470 MB in my Windows) if you try to do a adb reset - it brings the state of emulator to offline and no more adb commands work. (also no network calls seem to be working)
If you just created the emulator, in the emulator settings:
1.just click on "About the emulator" -> "Build Number" about 5-7 times.
2.This will open "developers options", go back and click on it and enable "USB debugging"
to bring it online.
Use these commands from the command prompt it will help u
1.adb kill-server //kill all active server
2.adb start-server //start adb server
3.adb devices //check the list of active server
Sometimes/most of the times the solutions described above works. But if it does not, and you had "Launch from snapshot" enabled, killing the emulator and restarting it WITH LAUNCH FROM SNAPHOT DISABLED, will let you of the hook.
I had this problem many, many times in the last few weeks, and although adb kill-server followed by adb devices works 4 times out of 5, that fifth time the only way to get it working again is by disabling the 'launch from snapshot' option. My guess is that the emulator is somehow in a 'wrong' state, but do not understand why myself.
I have faced this problem many times. Some solutions are:
Solution 1:
the emulator
Select & Right Click on Android Project
Run Configurations
Go to tab Target
Enable option Wipe User Data on Emulator launch parameters
Run Application
Solution 2:
Run Emulator
Keep the Emulator, (no matter same error occurs)
Make Sure the Home Screen of Emulator is appeared
go to Window -> Show Perspective -> DDMS --> In Devices Panel -> on Corner Drop Down Menu
Reset adb
Solution 3:
Reset adb manually or using the command line.
Might be helpful for a new user.
This issue can be solved using the below steps:
Open AVD-Manager in android studio and choose the emulator which you want to run
and do the wipe data and cold boot, take reference from the attached pic:
If the doesn't work, go to emulated device and enable the developer options >
enable USB debugging.
When trying to run an android emulator (either from eclipse or the cmd line) it simply starts an empty black box with the title 0: (obviously replacing with the name of the avd!). It never boots - doesn't even get to the boot animation.
Logcat shows absolutely no output and devices shows it as emulator:5554 - offline
This happens regardlessof which avd I start - and they had all previously worked.
I'm running all this on linux.
Edit: interestingly it also now fails to recognise an actual phone plugged in with debugging enabled... Android dev is now effectively impossible on this machine until I fix this...
Edit #2: If I create a new emulator and/or edit an existing one (even if I don't actually change anything) enables it to boot. This obviously enables me to move forward, but there is clearly still a problem with adb (actual devices still won't connect) which I still need to fix.
Edit #3: Scratch that last edit - it seemed to work briefly, but not anymore...
The emulator is a horribly slow piece of junk. Startup times of ten minutes or more are not unheard of. You are better off connecting an actual Android device via USB. If you insist on using the emulator, keep it running between debugging sessions to preserve its state (and your sanity).
Do adb reset in eclipse ddms devices view
and go to adb try this
adb shell stop
adb shell start
Ran into this problem in Eclipse--was getting errors in my XML files--as a result my R variable was unable to resolve. When the new Android Application project is created, another appcompat_v7 project is also created. These two projects are associated. The problem cropped up when I kept my main project open, but closed my appcompat_v7 project. When both were open at the same time, the problem disappeared.
Simple, but there it is.
I'm using Eclipse Indigo and up until just a couple hours ago or so everything was working fine. When I just relaunched it and made a couple changes, I ran the program on my phone but my logs were not being displayed. The phone's logs are displayed in the logcat, but nothing from the project is. I have the device selected, I've tried restarting eclipse multiple times, I've reset the ADB, and I've run the commands adb usb and adb logcat (which still doesn't display my logs). I know my logs are correct: Log.e("Tag","Message"); Anyone have any other ideas?
As it turns out, it was a stupid error on my part. I had my logs set up as: Log.e("Tag","") instead of: Log.e("","Message"). Apparently, if you have the former, it won't display to the LogCat, go figure?
I think, you haven't selected device or emulator , on which running your application,
In eclipse go to DDMS Perspective and select device or emulator on which you are running your application.
(Note: No need to restart the Eclipse)
I'm trying to run the very simplest app on MonoDroid though the MonoDevelop IDE - i.e. the one that is created as part of the new project (the one that increments the lable on button clicks - i won't post code as I don't think it is relevant unless someone really wants it).
When I press the run menu item then run (or debug) i get the emulator selection
I dutifully start the emulator - (I've tried API_7, API_10, API_12) and that works OK. But the IDE above never refreshes to show the currently running emulator so I can't launch the application. I have manually refreshed but the same list comes up. What I am expecting is the new emulator to appear in the list and the OK button becoming active.
I have tried running adb devices in the command line and I can see that the debug bridge has picked up the device i.e. it says emulator-5554 which matches the TCP/IP port that the emulator is running on.
I've also tried restarting the debug server i.e.
adb kill-server
adb restart-server
But I can't see the emulator appear on the above dialog. The debug server is running on port 5037. Could the IDE be listening to a different port?
Fundamentally I'm trying to get the simplest app running through MonoDevelop. And I'm failing. Please help good people.
I had the same problem initially when I tried running the emulators. My recommendations from my own experience would be to:
Run the Android SDK manager and retrieve all the latest SDK packages.
Create your own Android Virtual Device via the AVD Manager rather than running those that are listed when the IDE is intially run. You should then start the AVD manually via the AVD manager and ensure it is fully loaded before starting the de-bug.
My main problem with developing in Android is that the emulator seems to continually get disconnected from eclipse. This always happens the 2-3 time I try to upload my .apk from eclipse without rebooting the emulator. Eclipse indicates this with an empty DDMS ->Device section and logcat stays blank - sometimes I'm not sure if the new code made it on the device.
The only fix I have for this is to shut down eclipse, and restart it. With the restarting of Eclipse, on top of the emulator boot time, I can't get any momentum going in my development.
Is there a way to reconnect the emulator to eclipse without having to restart Eclipse or even the Emulator?
Update: There were a couple of answers that helped, particularly "reset adb" or Kill-server -> connect adb. However, sometimes even that is troublesome.
I am going to try Pentium10's suggestion of hooking up my G1 and using it as an emulator, but for now, I have found that if I don't see my logcat going, and the emulator is working (This is my biggest problem, because I am outputting all my debugging messages to log) then I can open up CMD and type adb logcat. This streams the log into the command window. Not nicely color coded, but nice enough for me to find my problems...
In eclipse go to Window->Show View->Other->Android->Devices. When your application is run go to this tab and you will see the emulator. If your emulator becomes unresponsive, in the devices tab you will see a down arrow at the right. Click the arrow and a context menu shows up. Hit the option Reset adb.
Just had to do this and it worked beautifully, but it did require you to reset the emulator - though I didn't wait to see if it reconnected on its own.
Try to call 'Reset adb' menu item from DDMS > Devices tab. It helps me in this case.
At most of the time you don't need to restart the emulator.
AFAIK the only workaround for this is to restart Eclipse (I always use this), or use a real phone.
Try adb kill-server, followed by an adb connect
I've had luck reconnecting to the disconnected emulator by entering an adb-over-tcp command line which you can look up in the docs. I think the address and port to use are the ones in the title bar of the emulator window, if not try the next higher port. Once it's back in adb devices eclipse should use it.
in terminal:
$adb kill-server && adb start-server