1. adb install [-lrtsdg] <file>
安装APK文件。
Args | Description | 个人理解 |
---|---|---|
-l | forward lock application | 锁定当前file |
-r | replace existing application | 替换已存在的,会保留数据 |
-t | allow test packages | 允许调试 |
-s | install application on sdcard | 安装到SD卡 |
-d | allow version code downgrade | 允许低版本覆盖高版本 |
-g | grant all runtime permissions | 授予所有runtime权限 |
adb install –r C:\Users\dxl\Desktop\fenxiao.apk
多个设备的话:
-s <serialNumber>
如
adb -s cf264b8f
2. adb push [-p] <local> <remote>
拷贝file/dir
(官方如是说)到设备
Args | Description | 个人理解 |
---|---|---|
-p | to display the transfer progress | 显示拷贝进度 |
注:
adb install 是将APK安装到data/data/目录下,作为普通用户应用软件。
adb push 不是安装命令,它是将file/dir写入设备的存储系统中;因此,只要有相应的权限,就可以将文件放到任何目录下,当然也就能将APK文件push到system目录下,作为系统应用程序。
adb push -p C:\Users\dxl\Desktop\fenxiao.apk /sdcard
3. adb pull [-p] [-a] <remote> [<local>]
从设备拷贝 file/dir
(官方如是说) 到 local 指定的目录。
Args | Description | 个人理解 |
---|---|---|
-p | to display the transfer progress | 显示拷贝进度 |
-a | means copy timestamp and mode | 复制时间戳和模式 |
adb pull -p /sdcard/com.liankai.fenxiao/databases C:\Users\dxl\Desktop\1
4. adb uninstall [-k] <package>
卸载APK。
Args | Description | 个人理解 |
---|---|---|
-k | means keep the data and cache directories | 保留当前 APP 的数据和缓存目录 |
adb uninstall com.liankai.fenxiao
5. adb shell rm -r
删除文件或文件夹
adb shell rm -r /sdcard/com.liankai.fenxiao
adb shell rm -r /sdcard/1.png
6.adb shell screencap
adb shell screencap -p /sdcard/1.png
adb pull /sdcard/1.png D:\fx
截图
7. adb shell pm list packages
获取已安装应用
未完,待更新
网友评论