adb devices #查看已经连接的设备
adb shell pm list packages -s #列出系统应用的所有包名
adb shell pm list packages -3 #列出除了系统应用的第三方应用包名
adb shell dumpsys window | findstr mCurrentFocus #显示正在运行的程序和界面
adb shell dumpsys window | findstr mFocusedApp #显示正在运行的程序和界面
adb shell getprop ro.build.version.release #查看系统版本
这些命令都是在命令提示符里输入的,打开命令提示符的方法:win+R然后输入cmd
mCurrentFocus里的com.huawei.android.launcher为应用的包名,com.huawei.android.launcher.unihome.UniHomeLauncher为当前的界面,
获取了这几个主要信息以后就可以打开pythoncharm来进行操作了
我原本知道的查看当前界面的应用包名的代码是adb shell dumpsys windows window | findstr mFocusedApp,视频里可以用但我输入却无效,不知道是咋回事,困惑了我好久,最后还是决定用现在的这些就好了