Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use "Select debug app" and "wait for debugger" new feature in jelly bean?

Tags:

"Select debug app" and "Wait for debugger" are new feature in Jelly Bean, does someone know how to use these new features?

like image 924
gladman Avatar asked Aug 14 '12 07:08

gladman


People also ask

How do I wait for debugger?

Go to Settings > Developer options > Select debug app and choose your app from the list, then click Wait for debugger. Wait for the app to load and a dialog to appear telling you the app is waiting for a debugger.

How do I select a debugger app?

Navigate to Settings -> System -> Developer options and then scroll to the Debugging section. Click on “Select debug app”. Select the application you want to debug from the list.

What is select debug app in Developer option?

When using a remote debugger to debug an app on your device, this setting allows you to relax a few restrictions on the ability for developers to pause execution of the chosen app while debugging.

How can you debug your app when it's already released?

If your app is already running, you don't need to update it to add the breakpoint—just click Attach debugger to Android proccess . Otherwise, start debugging by clicking Debug .

What is the “wait for debugger” option?

When an app is selected using this option, debugging of this app via an attached debugger is allowed to pause execution of the app at a breakpoint for a long period of time without issuing a warning, and enables the Wait for debugger option allowing the execution of this app to pause after launching until the debugger is able to attach to it.

How do I debug an app on Android?

This allows you t debug your apps, and to use adb to copy files, check processes running on your device, etc. Press Select debug app, and select your application. Optional: enable Stay Awake. This is nice to avoid your Android from locking while you are trying to run and test apps on your device.

How do I change the debug type in Android Studio?

From the Debugger drop-down menu, you can select a different debug type. By default, Android Studio uses the Auto debug type to select the best debugger option for you, based on whether your project includes Java or C/C++ code.

How do I switch from run to debug mode?

If you see a dialog asking if you want to "switch from Run to Debug," that means your app is already running on the device and it will restart in order to begin debugging. If you'd rather keep the same instance of the app running, click Cancel Debug and instead attach the debugger to a running app.


2 Answers

I found the answer here: http://developer.android.com/tools/debugging/debugging-devtools.html

Lets you select the application to debug. You do not need to set this to attach a debugger, but setting this value has two effects:

  • It will prevent Android from throwing an error if you pause on a breakpoint for a long time while debugging.
  • It will enable you to select the Wait for Debugger option to pause application startup until your debugger attaches (described next).
like image 199
Brent Avatar answered Nov 06 '22 16:11

Brent


It is a mystery to me also, but I'll share my experience. I cannot see that these options change the phone's behavior. Regardless of the settings I choose, the Galaxy Nexus behaves like my older phones that do not have the settings.

"Waiting for debugger" is a dialog that I see whenever I start running an app from Eclipse. It stays up for a while, and then my app starts running. This has been the case since I started Android development, and it still works that way on my old and new devices, regardless of the setting.

If I click on "Select Debug App", it allows me to select an app from the already installed apps on my phone that allow debugging, which are the apps that I wrote myself.

On my Galaxy Nexus it does not matter whether I select "Nothing" or one of my debuggable apps, I can still debug any app from Eclipse. I cannot even see a difference in time it takes to load an app over the ADB connection.

like image 32
gabriel Avatar answered Nov 06 '22 14:11

gabriel