下面是一个使用Java编写的示例代码,它通过执行adb命令来获取当前正在运行的activity的信息: importjava.io.BufferedReader;importjava.io.InputStreamReader;publicclassCurrentActivity{publicstaticvoidmain(String[]args){try{Processprocess=Runtime.getRuntime().exec("adb shell dumpsys activity | grep \"mFocusedAc...
有兴趣可以先看看这个网站中列出的命令http://adbshell.com 获取手机型号 adb shell getprop ro.product.model 获取系统版本 adb shell getprop ro.build.version.release 获取包名 adb shell pm list packages 获取操作的acticity adb shell dumpsys window | findstr mCurrentFocus最后编辑于 :2019.07.31 14:47...
adb shell dumpsys activity activities adb命令获取当前界面Activity 执行结果为:com.baidu.searchbox/.MainActivity t3 adb shell dumpsys cpuinfo查看手机端cpu的使用率 adb shell getprop | findstr dalvik 查看本机内存的使用情况(所有的app) adb shell dumpsys meminfo +包名查看具体的apk的内存使用率 adb locat...
adb shell dumpsys activity activities //查看activity信息 adb shell dumpsys activity |findstr mResumedActivity //获取当前activity信息 adb shell dumpsys window windows | findstr “Current” //查看当前app窗口activity adb shell //进入设备内部 cd //切换目录 pwd //查看当前路径 ping //查看网络连接 rm...
以下命令部分是需要有root权限的 1. 获取手机中执行Monkey的进程号 : adb shell pgrep commands.monkey 2. 查看前台显示的Activity: adb shell dumpsys window | grep mCurren...
adb shell dumpsys power 1. d)获取包名和界面名: adb shell dumpsys window | grep mFocusedApp adb shell "dumpsys window | grep mCurrentFocus" 1. 2. e)获取启动时间: adb shell am start -W 包名 1. adb shell pm list packages 列出包名 ...
使用-e参数且设置过滤条件:adb shell pm list packages -e "browser",只输出启用的包。 查看启动activity adb shell dumpsyspackage包名 版本 # getprop ro.build.version.release getprop ro.build.version.release 7.1.2 CPU 硬件 # cat /proc/cpuinfo ...
adb shell netstat: 显示网络连接状况。 adb shellcat/proc/cpuinfo: 显示设备的CPU信息。 adb shell getprop: 显示设备的属性信息。 adb logcat: 显示设备上的日志信息。 adb shell am start-n <package>/<activity>: 启动应用程序。 adb shell input text<text>: 在设备上输入文本。
adb shell pm clear 包名:清除应用缓存 效果相当于在设置里的应用信息界面点击了「清除缓存」和「清除数据」。 5)查看前台 Activity(查看当前活动窗口的类名) adb shell dumpsys window | findstr mCurrentFocus 6)查看应用安装路径 adb shell pm path <PACKAGE> ...
获取当前应用包名和activity adb_cmd = **'adb -s %s shell dumpsys window | grep mCurrentFocus' **% self.udid 获取设备语言 cmd = **'adb -s %s shell getprop persist.sys.locale' **% (self.udid) 判断是否安装了某个应用 adb_cmd = **'adb -s %s shell pm list packages | grep "%s"...