先用usb链接手机
启动要查看的程序,命令查看当前运行的包名和Activity更清晰。
使用adb shell dumpsys window | findstr mCurrentFocus 命令查看当前运行的包名和Activity更清晰。
3.adb 查看前台运行的app包名,和启动名。
windows环境下:
adb shell dumpsys activity | findstr “mFocusedActivity”
linux:
adb shell dumpsys activity | grep “mFocusedActivity”
zhouweisongdeMacBook-Pro:~ zws$ adb shell dumpsys activity | grep “mFocusedActivity”
mFocusedActivity: ActivityRecord{2b608b2 u0 com.xxzb.fenwoo/.activity.MainActivity t27}