App is running on Android Monitor but not on android - android

As I wanted to debug my app, I clicked the Debug button. After this, if I was trying to run the app manually, a message appeared saying "Waiting for debugger to attach...". I turned off and turned on the "Debuggable app" option in the Developer settings and rebooted my phone and this dialog disappeared.
But now when I'm trying to click the Run button in Android Studio, the app doesn't run, but lines of log are running at the ADB window (Android monitor). Feels like it's running in the background.
The only way to launch my app and track it is to click the Debug button, set the Breakpoint, run the app manually, click the Debug button again. But I don't want to Debug!
P.S. Sorry for that bad English.

Stop the debugging process and rebuild your project. It works for me. Try it.

Related

Why wont my Android app automatically run from Android Studio?

I am trying to run my app in debug mode on an Android device from Android Studio. I press the Debug 'app' button and it goes through the build process and then it says "Launch succeeded" in a bubble above the Debug tab, but the app doesn't start running. If I press the Debug button again though it does start and it says "App restart successful without requiring a re-install" in a bubble above the Run tab. Why won't it start the first time? I have "Launch" set to "Default Activity" under the Launch Options. Is there anything else I need to do? Thanks!

“Waiting for Debugger” without be on debug mode

Android studio changed something and now ALWAYS that i run my app it get stuck in a screen "waiting for debbuger"
then i need to go at "chooser process" and attach the debuger to my app. BUT IT IS VERY ANNOYING mainly because i dont want to debug i just pressed RUN
how can i fix it and stop this bad error at least when i'm not debuging
There is an option of Attach Debugger to Android Process
Looks like you have added your app in Select app to be debugged in Settings -> Developer Options -> Select app to be debugged
To resolve this, simply go to Select app to be debugged and click on No apps

How to automatically connect the Eclipse debugger when the android app is restarted on the device?

I am using Eclipse. I have a breakpoint on onCreate that I want to catch in debug mode when my application is restarted by android because of multitasking. I can connect the Eclipse debugger to my restarted app on the DDMS perspective, but I am never fast enough to catch the breakpoint in onCreate. How to automatically connect the Eclipse debugger when the android app is restarted on the device?
Run the app in debug mode. Right click on project there will a option Debug as below Run as.
Run the app in debug mode. But don't forget to add break point first before running app in debug mode
is restarted by android because of multitasking
Not sure what you really mean by this, but if this imprecise description refers to asynchronous operations (i.e. using AsyncTask) then you may want to add this line before your breakpoint set in code that is run on other than main task:
Debug.waitForDebugger();
Please note that to make it work you need to launch your app in debugging mode (F11)

Why has the Eclipse Debugger/Emulator disconnected from my app?

My app is no longer starting up automatically when I F11 it in Eclipse; the Emulator starts up, but I then have to go and find my app among the applications list/array to invoke it.
Then, when I get to the place in my app where I've set a breakpoint, instead of hitting the breakpoint (Eclipse is not even going into Debug Perspective), my app suddenly "expires" and the Emulator pops up the dialog:
~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry!
The application FifeOrTheDinosaur (process.com.aXX3AndSpace.FifeOrTheDinosaur_Package) has stopped unexpectedly. Please try again.
Force close
~~~~~~~~~~~~~~~~~~~~~~~~~
But then when I click "Force Close," that dialog goes away, and my app starts up again, from its opening Activity...?!?
It's almost as if my app is not the one being debugged by Eclipse -- Eclipse has lost its connection to it or...???
And every time it crashed, I hit the "Force Close" button, whereupon my app starts up all over again. What could have disconnected my app from the Debugging system, so that it:
1) Doesn't run automatically when I run it; rather, I have to "force" it to start up, and when it enters a breakpoint, Eclipse's Debug Perspective is not invoked
2) Continually starts up my app after it has failed...???
I put a breakpoint on a button click handler prior to that one that is working fine, and it does not drop me into the Eclipse debugger, either...???
Update:
The console says:
1) ] Failed to install .apk on device 'emulator-5554': timeout
2) Launch canceled!
Updated 3/30/2012:
If I run the app from Eclipse and immediately shut it down just as the Emulator is starting to initialize, it flashes up three "command window"-type screens, one right after the other, too fast to read what text they contain. Normally the Emulator window simply goes away, so I don't know if this is a clue for anybody as to what might be happening...
That sounds like the normal behavior of android Apps. If one activity crashes you can still go back to the activity the App started with. And if the breakpoints aren't hit then the error might occure before the code line you want to stop at.
Maybe you could set a breakpoint before you change the activity and then debug from there on.
You could also provide your Log output. Errors like that can always happen if you forgot to declare permissions or activities in your Android Manifest.

Eclipse android error

Everytime I start the emulator from eclipse, I get the following error in my console.
[2010-09-13 17:04:51 - DeviceMonitor]Sending jdwp tracking request failed!
[2010-09-13 17:18:49 - DeviceMonitor]Sending jdwp tracking request failed!
The application works fine, but I am concerned as to why I see this error. Please help
I believe this is coming from the Usage Stats option. I just installed ADT, did a test run and got this error, as well. I went to Window >> Preferences >> Android >> Usage Stats then checked it on. Tried another test and voila! No error!
Kind of annoying, I can imagine...
This is caused after the emulator is closed while eclipse is still running.
When you first run the emulator after starting eclipse, a connection is established between it and eclipse. This connection is used to send messages back and forth between the two programs, and so eclipse can track the progress of the emulator.
When the emulator is closed, the connection is lost, and any attempt by eclipse to send a message results in the error messages you describe.
As Koby said this message comes if you close the emulator after running an application. First of all between successive application running on emulator you don't need to close the emulator. First before running the application you start the emulator by clicking window-->Android SDK and AVD Manager and click on the emulator you want to launch and click on 'start' button and then click on 'Launch' to launch the emulator. After the emulator launches unlock the emulator and keep that emulator minimized. And if you want to run an application go for 'run as android app' and you can see that on the emulator when maximized. After running that application if you want to make some changes in the application you don't need to close the emulator. you press the home button after running the application and keep the emulator minimized. Make the changes on the code and again go for running the application. Thus you can avoid that error message and save time for launching the emulator. if you got that error message then also the application will work properly but you cannot see the messages like uploading app-->installing .apk-->and the success messages. But these will be happening on the background. One way to overcome this is to restart the eclipse.

Categories

Resources