I get an error in the android emulator. "The application AppName has stopped unexpectedly. Please try again.
How do I use the debugger to troubleshoot where the error occurs
This is a pretty big question. Here is the standard Android documentation for debugging android apps:
http://developer.android.com/guide/developing/debugging/index.html
I don't usually answer with a link.. but honestly this it's probably easiest just to go through the piece of the URL. breakpoints and log events.
http://www.vogella.de/articles/EclipseDebugging/article.html#usedebug_breakpoints
you should also look at the log file. By default android logs all messages to a log file which you can access on your command line as "adb logcat". For more on adb tool loot at here
I am not sure what kind of debugger you want. AFAIK, two debugger can be used in android: ADB and gdbserver. If you want debug java code, you can use ADB. You can issue "adb connect localhost" in shell to make adb connect to your emulator. Then you can use "adb logcat" to see the log of your emulator. Mostly, the emulator will give you log about where the error occurs in your java code.
I just recompiled after waiting a longgggg while without changing code (I did remove code and a xml file, but undid it with cntl+z) and then it worked without issues - sigh –
I like to use Logcat. Logcat will give you a pretty detailed error message with the lines that the error occurred on. You can open up the Logcat perspective in Eclipse by going:
Window -> Show View -> Other (if Logcat doesn't show in the list) -> Logcat
I prefer this to the debugger because the emulator runs a bit faster.
Related
I'm trying execute my application, but it occurs the following problem:
Failed to start Emulator console for 5554
I've already done:
Clean and Build Project and restart
Check:
if you have downloaded all of the emulator files from the SDK Manager for the version you're trying to use.
if you have enough RAM left to use for the emulator (remember that you define it in the device config)
if there's not another emulator already running.
Another way to know what's the problem is to check the LogCat, it provides very useful information about errors and all the stuff running, if you can't figure the problem reading it, try to ask a question with the error message FROM the LogCat, not only the one from the windows in your screen.
I had the same problem.
Finally I launched the emulator in command line. use "sudo ./emulator #(your device name)", and it can work properly with port 5554.
I'm struggling a bit with Logcat. The phone disconnects from LogCat with the message "Device Disconnected" every time I push a button changing intents in my program.
What can cause this? And Why? Could it be my code throwing a error disconnecting LogCat? Or is this a LogCat issue?
I'v tried to restart eclipse, and stop the adb.exe process with no luck.
: E/(): Device disconnected
There may be some sync problem in DDMS. Just restart the eclipse it will work fine.
This is a real problem in Eclipse DDMS. If you run adb logcat at the same time that Eclipse shows "device disconnected" you will most likely still see logcat output (this is what happens in my case). Only real explanation I can see is that DDMS has a bug.
My solution? Switch to IntelliJ. It doesn't have the same problem, or any similar problems that Eclipse DDMS has connecting to devices which are recognized by adb.
Here is commented a solution that works for me, Clear Log:
LogCat Stops Running in Eclipse Needs Restart
I restarted my device, closed eclipse, used a command prompt opened at android-sdk/platform-tools to run adb kill-server, reopened eclipse, and then used that same command prompt to run adb logcat.
My problem was then fixed, though I'm not sure which step fixed it.
Just Type This Command In Terminal
adb devices
u should see this log:
List of devices attached
adb server version (40) doesn't match this client (36); killing...
* daemon started successfully *
FA57NY900383 device
And Run Again, Your application starts to run on your device
So I resolved the issue. I'm not sure what part did the trick, but I noticed javaw.exe was running on the computer even though eclipse was closed. So I forced closed this one, unfortunately I also re-installed my Jelly Bean ROM. So I'm not sure what exactly did the trick. I bet it was the phone though.
I had this same problem where it kept saying "Device Disconnected" when I could clearly hit Debug and select my phone, but for some reason I was expecting the LogCat to already be going.
But it will not be going if the phone is locked (facepalm).. After unlocking it seems fine.
Hope this helps someone else that doesn't realize their phone is locked when trying to debug / use LogCat.
I am using android-x86 2.2 version as a live cd, adb tool is not avilable to see logcat so suggest some alternative to see system logs.
I found the solution to see the log first press Alt+F1 then write logcat at the terminal then hit enter you will be able to see logs.
few days before when i was trying to run my apps the following type of error used to occur
[2011-02-24 20:33:41 - FlashCard] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2011-02-24 20:33:41 - FlashCard] Please check logcat output for more details.
[2011-02-24 20:33:41 - FlashCard] Launch canceled!
i used to close the eclipse or shut down my system, then it gets cleared.
Later it happens to occur often, i got a suggestion from stack overflow to enter command
adb start-server and adb kill-server in run cmd, the idea worked only for two days.
Right from today morning i am trying to run all my apps and the same error continues.
The adb server idea is not working, i have tried updating my eclipse too.
i am posting this just to get an idea about this problem, as i am new to android development and java.
if anyone have any solution or idea pls share it.
Please follow below link for the solution
Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on Android
and top of this try to clear other application's data from the setting->application->manage application
Have you tried freeing up space on your device/emulator by uninstalling apps?
I am no good with hardware concepts. So I have this probably very silly doubt.
I want to add Log to my application. When running on an emulator, I know where to see the Log output - it's visible in the Logcat window of Eclipse.
I want to know where I can see these logs when I run it on a hardware device. I am using following command to load my app on to the device : ./adb install helloWorld.apk
So where will the log be created and under what name?
Apologies if the question is vague or silly. I really do not know more details.
-Kiki
Try to use:
./adb logcat
When you run on device, the log is also available in LogCat. You will need to turn on USB debugging (Settings > Applications > Development > USB Debugging) in your device, then you can use LogCat just like in the emulator, both using ./adb logcat and in Eclipse.