问题
I'd like to check for memory leaks in my Android app using the DDMS feature in Eclipse. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.
However, when I connect my Droid to the PC, the device shows up just fine in DDMS. The logcat is generated correctly, and I can view the file structure. However, threads do not display. I get "no client selected" in the Threads pane, and there is no drop-down icon next to the device listing.
Do I need to change some particular setting in Eclipse? Is this maybe a driver issue?
回答1:
Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default
Add Android Device view to get device pan(e) noted above
Set android:debuggable=true (two g's) in app tag as noted above
Run your app in emulator
Select device in device pane
Click the update threads button
Enjoy
回答2:
Make sure you have android:debuggable="true" in you application tag in the manifest file
回答3:
This is expected behavior. The issue is your droid is not in debug mode. Notice that in the Devices pane, beside the version number, debug is stated against the emulated device but not in the case of the droid.
From what I have found so far - on the droid, only an app can be run in debug mode; and only this will be listed under your device in DDMS.
I don't know how to run(/boot) the entire droid in debug mode, or if it is possible. So far as it appears, there is no way to boot an entire real device in 'debug' more.
回答4:
Go to DDMS
Select device in device pan
Look at header of this pane. You can see update threads
You can see thread and updates from device
回答5:
If you use Intellij Idea like me - run monitor from tools-> android, other way Idea built in ADB conflict with ddms.
回答6:
On Android Studio : On the DDMS (Dalvik Debug Monitor Server) Screen: Show View -> and then select the profiling view you need.
来源:https://stackoverflow.com/questions/2889530/ddms-not-showing-threads-from-device