進(jìn)行seo網(wǎng)站建設(shè)今日最新的新聞
查看屏幕分辨率
adb shell wm size
查看dpi
adb shell dumpsys window | grep ‘dpi’
WIFI調(diào)試:
- adb tcpip 5555
- adb connect 設(shè)備ip
注意,USB拔插會(huì)斷掉,所以插上USB后再 adb connect 設(shè)備ip?!咀⒁狻咳A為手機(jī)自建熱點(diǎn)的ip一般是192.168.43.1
adb獲取root
- adb root
- adb remount
adb 查看當(dāng)前應(yīng)用包名
adb shell dumpsys window | grep mCurrentFocus
查看一個(gè)activity所關(guān)聯(lián)的service
adb shell dumpsys activity s [package-name]
例如:adb shell dumpsys activity s dji.go.v4
proguard gui
在 ~/Library/Android/sdk/tools/proguard/bin 下面
查看一個(gè)應(yīng)用的內(nèi)存情況
dumpsys meminfo [package-name]
當(dāng)有多個(gè)設(shè)備時(shí),adb選擇指定設(shè)備
adb -s [serial-number] [cmd]
查看系統(tǒng)中所有已安裝的包
adb shell pm list packages -f
查看系統(tǒng)中運(yùn)行的進(jìn)程
adb shell ps (舊版android的ps是toolbox版本的ps)
adb shell ps -A (新版android的ps換成了toybox版本的ps)
殺死一個(gè)應(yīng)用程序
adb shell am force-stop [package-name]
查看當(dāng)前的activity
adb shell logcat | grep ActivityManager
adb shell dumpsys activity activities
模擬用戶按home鍵把a(bǔ)pp退到后臺(tái),然后系統(tǒng)因資源不足而殺死app,
此時(shí)用戶再通過(guò)應(yīng)用列表回到app,此時(shí)app已經(jīng)死掉,但是activity棧還在,
因此系統(tǒng)拉起的是退出時(shí)的activity,而不是重新走一遍app啟動(dòng)流程
adb shell
su
kill [pid]
查看當(dāng)前activity所在的task
adb shell dumpsys activity activities
在其中搜索 ‘Running activities’,其中的 TaskRecord 就表示一個(gè) task 堆棧
獲取當(dāng)前手機(jī)的危險(xiǎn)權(quán)限
adb shell pm list permissions -d -g
am啟動(dòng)應(yīng)用并統(tǒng)計(jì)啟動(dòng)時(shí)間
adb shell am start -W -n [package name]/[launcher activity的全限定名]
adb shell am start -W -n dji.go.v4.debug/dji.pilot.main.activity.DJILauncherActivity
查看AndroidManifest.xml中信息總匯
aapt d badging [Your apk’s path]
adb logcat 出現(xiàn)EOF
adb logcat -G 2m
清除logcat緩存空間
adb logcat -b all -c
發(fā)生anr,獲取traces.txt
adb pull data/anr/traces.txt
proguardgui反混淆
java -jar ~/Library/Android/sdk/tools/proguard/lib/proguardgui.jar
內(nèi)存使用情況
adb shell dumpsys meminfo [package name] -d
adb 模擬觸摸屏幕(人工操作經(jīng)常一按就很多 MOVE)
adb shell input swipe [source.x] [source.y] [dst.x] [dst.y] [duration/ms]
例如 adb shell input swipe 300 1400 300 1420 1
查看包名
adb shell pm list packages -f | grep ‘xxx’
以 attach debugger 啟動(dòng) app
讓調(diào)試器 attached 上后采取執(zhí)行 Application 的啟動(dòng):adb shell am set-debug-app -w --persistent dji.mimo.debug
使用 adb shell am clear-debug-app 來(lái)清理
IMEI
adb shell getprop persist.sys.factory.imei