-
管道命令:过滤
- windows用findstr, linux用grep
-
查看运行的服务:
- adb shell
- ps -A|grep com.ehome.print.service
- service list | grep ehome
- adb shell
-
查看当前activity
- adb shell
- dumpsys activity top | grep ACTIVITY
- adb shell
-
查看内存使用情况
- adb shell
- dumpsys meminfo --package $package_name
pakageName不传为查看全部
- adb shell
-
查看分辨率等信息
- adb shell
- dumpsys window displays
- adb shell
-
查看安装的应用信息
-
adb shell
- pm list package
- dumpsys package [PackageName] [| grep versionCode]
-
-
启动activity
- adb shell am start -n {activity全路径,跟包名相同的部分可用"."代替}
-
启动系统设置页面
- adb shell am start -n com.android.settings/.Settings
-
关闭应用
- adb shell am force-stop com.android.settings
-
拉取日志
- adb logcat –v time > d:\log.txt
-
从设备中拉取文件
-
获取框架源码
- adb pull /system/framework/framework.jar
- adb pull /system/framework/framework2.jar
-
拉取文件
- adb pull <设备路径> <本地路径>
-
-
授予应用所有运行时权限
- adb shell install -g ${PATH_TO_APK_FILE}
-
按组列出权限和状态:
- adb shell pm list permissions -d -g
-
授予或撤消一项或多项权限:
- adb shell pm [grant|revoke] $packageName android.permission.READ_CONTACTS
-
禁止运行:
-
adb shell:
- pm disable-user com.ehome.update.service
-
-
屏幕旋转成横屏
- adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
-
查看设备ip
-
adb shell:
- ifconfig
-
-
打开网络调试
- adb tcpip 5555
-
关闭网络调试
- adb disconnect
-
查看内存状态
- adb shell procrank
-
查看内存信息
- adb shell cat /proc/meminfo