Android DDMS 不显示来自设备的线程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2889530/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:45:22  来源:igfitidea点击:

DDMS Not Showing Threads From Device

androideclipseddms

提问by polyclef

I'd like to check for memory leaks in my Android app using the DDMSfeature in Eclipse. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.

我想检查使用在我的Android应用程序的内存泄漏DDMS的功能Eclipse。当我启动模拟设备时,模拟设备的线程显示正确,从 8600 及更高版本开始。

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.

但是,当我将 Droid 连接到 PC 时,该设备在 DDMS 中显示得很好。logcat生成正确,可以查看文件结构。但是,线程不显示。我在“线程”窗格中显示“未选择客户端”,并且设备列表旁边没有下拉图标。

Do I need to change some particular setting in Eclipse? Is this maybe a driver issue?

我是否需要更改 Eclipse 中的某些特定设置?这可能是驱动程序的问题吗?

回答by bassetbob

Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default

Eclipse 首选项 (OSX) > Android > DDMS > 检查默认启用的线程更新

Add Android Device view to get device pan(e) noted above

添加 Android 设备视图以获取上面提到的设备 pan(e)

Set android:debuggable=true (two g's) in app tag as noted above

如上所述在 app 标签中设置 android:debuggable=true(两个 g)

Run your app in emulator

在模拟器中运行你的应用

Select device in device pane

在设备窗格中选择设备

Click the update threads button

单击更新线程按钮

Enjoy

享受

回答by Jason

Make sure you have android:debuggable="true"in you application tagin the manifest file

请确保你有android:debuggable="true"application tag的清单文件

回答by Ujjwal Singh

This is expected behavior. The issue is your droid is not in debugmode. Notice that in the Devicespane, beside the version number, debugis 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.

这是预期的行为。问题是您的机器人未处于调试模式。请注意,在Devices窗格中,版本号旁边debug是针对模拟设备声明的,但不是在机器人的情况下。
从我目前发现的情况来看——在机器人上,只有一个应用程序可以在调试模式下运行;并且只有这会在 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.

我不知道如何在调试模式下运行(/引导)整个机器人,或者是否可能。就目前看来,没有办法在“调试”中启动整个真实设备。

回答by Prasham

Go to DDMS

转到 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

您可以查看来自设备的线程和更新

回答by George Vinokhodov

If you use Intellij Idea like me - run monitor from tools-> android, other way Idea built in ADB conflict with ddms.

如果您像我一样使用 Intellij Idea - 从工具运行监视器-> android,ADB 中内置的 Idea 与 ddms 冲突的其他方式。

回答by sivi

On Android Studio : On the DDMS (Dalvik Debug Monitor Server) Screen: Show View -> and then select the profiling view you need.

在 Android Studio 上:在 DDMS(Dalvik Debug Monitor Server)屏幕上:显示视图 -> 然后选择您需要的分析视图。