FAutoTest icon indicating copy to clipboard operation
FAutoTest copied to clipboard

小米手机无法获取进程ID问题及解决方案

Open huhust opened this issue 6 years ago • 5 comments

image

问题在于这个adb命令获取的是MIUI桌面的activity 的PID

试了下 adb shell dumpsys activity top | findstr com.tencent.mm,可以拿到,可以考虑针对这种情况优化一下获取PID的策略

huhust avatar Oct 31 '18 10:10 huhust

对,我是在下一步_fetchWeixinToolsProcessPid里再进行一遍处理,原理差不多,都是要再拿进程关键字去找,因为包括小米,华为等手机都有自己的UI线程在激活状态,无法确保该命令的唯一返回。

metoto avatar Nov 02 '18 00:11 metoto

能否提供一下手机的型号,以及rom的版本

Jaggerer avatar Nov 15 '18 02:11 Jaggerer

小米6 MIUI9.6稳定版本

huhust avatar Nov 15 '18 02:11 huhust

小米6 MIUI9.6稳定版本

你说adb shell dumpsys activity top | findstr com.tencent.mm可以拿到,是指adb shell dumpsys activity top 命令既拿到了UI桌面的activity,又拿到了微信webview的activity?能否提供一下adb shell dumpsys activity top的信息呢

Jaggerer avatar Nov 15 '18 03:11 Jaggerer

小米6 MIUI9.6稳定版本

你说adb shell dumpsys activity top | findstr com.tencent.mm可以拿到,是指adb shell dumpsys activity top 命令既拿到了UI桌面的activity,又拿到了微信webview的activity?能否提供一下adb shell dumpsys activity top的信息呢

我也遇到这个问题,获取的信息如下,建议兼容处理一下就好 ACTIVITY com.android.systemui/.recents.RecentsActivity cfd8db0 pid=1926 ACTIVITY com.miui.home/.launcher.Launcher a1809cc pid=2835 ACTIVITY com.tencent.mm/.plugin.appbrand.ui.AppBrandUI 1409efd pid=1610

crazymanpj avatar Dec 19 '18 14:12 crazymanpj