How to use Monitor (DDMS) tool to debug application
I'm switching my development environment from Eclipse to Android Studio these days. And I really enjoy its autocompletion and many other features this IDE provide. However, I have some problem when doing debugging.
I hope to use Monitor tool which this IDE provided, self-included DDMS and very nice visual interface to track memory usage, thread condition and so on. But I can't find a way that this could support step by step using breakpoints I have to create (That red dot in editor)
I can only do step by step debug by not open this Monitor. Since when I try to use Monitor while the debugger is running, it will popup a window asking me to disconnect the ADB first. I also can't find a place to start the application from Monitor.
Is there a way to do step by step debug while using Monitor at the same time in Android Studio?
Solution 1:
Go to
Tools > Android > Android Device Monitor
in v0.8.6. That will pull up the DDMS eclipse perspective.
Solution 2:
I think things (location) have changed little bit. For: Android Studio 1.2.1.1 Build @AI-141.1903250 - built on May 5, 2015
Franco Rondinis answer should be
To track memory allocation of objects:
- Start your app as described in Run Your App in Debug Mode.
- Click Android to open the Android DDMS tool window.
- Select your device from the dropdown list.
- Select your app by its package name from the list of running apps.
- On the Android DDMS tool window, select Memory tab.
- Click Start Allocation Tracking Interact with your app on the device. Click Stop Allocation Tracking (same icon)
Solution 3:
As far as I know, currently (Android Studio 2.3) there is no way to do this.
As per Android Studio documentation:
"Note: Only one debugger can be connected to your device at a time."
When you attempt to connect Android Device Monitor it disconnects Android Studio's debug session and vice versa, when you attempt to connect Android Studio's debugger, it disconnects Android Device Monitor.
Fortunately the new version of Android Studio (3.0) will feature a Device File Explorer that will allow you to pull files from within Android Studio without the need to open the Android Device Monitor which should resolve the problem.