install安装命令
adb install [-lrtsdg] <file>
- push this package file to the device and install it
app installation:
install [-lrtsdg] PACKAGE
-l: forward lock application
-r: replace existing application
-t: allow test packages
-s: install application on sdcard
-d: allow version code downgrade (debuggable packages only)
-p: partial application install (install-multiple only)
-g: grant all runtime permissions
uninstall [-k] PACKAGE
remove this app package from the device
'-k': keep the data and cache directories
-lrtsdg主要有六个选项
-l 锁定该应用程序
-r 替换已存在的应用程序,也就是说强制安装
-t 允许测试包
-s 把应用程序安装到sd卡上
-d 允许进行将见状,也就是安装的比手机上带的版本低
-g 为应用程序授予所有运行时的权限
获取IP地址
命令:
adb shell ifconfig "| grep Mask"
输出示例:
inet addr:10.130.245.230 Mask:255.255.255.252
inet addr:127.0.0.1 Mask:255.0.0.0
Mac 地址
命令:
adb shell cat /sys/class/net/wlan0/address
输出示例:
f8:a9:d0:17:42:4d
列出安装在设备上应用的包名
adb shell pm list package
Android系统对应的命令(部分为linux命令)
adb shell am start -n <package_name>/.<activity_class_name> // 启动应用
adb shell top // 查看设备cpu和内存占用情况
adb shell top -m 6 // 查看占用内存前6的app
adb shell top -n 1 // 刷新一次内存信息,然后返回
adb shell procrank // 查询各进程内存使用情况
adb shell kill [pid] // 杀死一个进程
adb shell ps // 查看进程列表
adb shell ps -x [PID] // 查看指定进程状态
adb shell service list // 查看后台services信息