獲取系統api版本
adb shell getprop ro.build.version.sdk
獲取系統版本
adb shell getprop ro.build.version.release
獲取手機分辨率
adb shell wm size
獲取屏幕密度
adb shell wm density
獲取手機型號
adb shell getprop ro.product.model
查看手機廠商
adb shell getprop ro.product.manufacturer
停止應用
adb shell am force-stop io.appium.uiautomator2.server
列出所有關於指定的包
adb shell pm list packages io.appium.uiautomator2.server
獲取安裝包的信息
adb shell dumpsys package io.appium.uiautomator2.server
列出手機中已安裝的instrumentation
adb shell pm list instrumentation
等待設備連接上
adb wait-for-device
輸出ping
adb shell echo ping
查看手機里正在運行的進程
adb shell ps
adb shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000
adb shell appops set io.appium.settings android\:mock_location allow
安裝包 adb insatll 包
獲取系統默認輸入法
adb shell settings get secure default_input_method
adb shell ime enable io.appium.android.ime/.UnicodeIME
adb shell ime set io.appium.android.ime/.UnicodeIME
pc上所有8200端口重定向到手機的6790端口
adb forward tcp\:8200 tcp\:6790
刪除json文件
adb shell rm -rf /data/local/tmp/strings.json
列出對應包名的所在位置
adb shell pm path com.xueqiu.android
將指定包拷貝到指定pc的臨時目錄下
adb pull /data/app/com.xueqiu.android-2/base.apk C\:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\com.xueqiu.android.apk
將pc上的json文件推送到手機上
adb push C\:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\com.xueqiu.android\\strings.json /data/local/tmp
清除數據和緩存
adb shell pm clear com.xueqiu.android
adb shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner
獲取當前活動窗口的信息
adb shell dumpsys window
獲取設備上Unix域套接字信息
adb shell cat /proc/net/unix