常見adb命令

手機截屏
adb shell screencap -p /sdcard/1.png

截屏導出
adb pull /sdcard/1.png D:/image/1.png

操作數據庫

  1. adb shell
  2. 進入數據庫 cd data/data/com.partner.tmsdemo/databases
  3. 列出當前目錄的文件 ls
  4. 打開數據庫 sqlite3 數據庫名,例如 sqlite3 student.db,打開student.db.
  5. 查看該數據庫所有表 .tables
  6. 查看錶的創建語句 .schema 表名 ,例如 .schema student ,查看student表單的創建語句.
  7. 還可以執行數據庫操作 ,例如 select * from 表名 ; 查看該數據庫的所有記錄,記得最後加上分號,否則不會執行.

回到系統桌面
adb shell am start -n com.android.launcher3/com.android.launcher3.Launcher

查看當前界面的名稱
adb shell “dumpsys activity activities | grep mFocusedActivity”

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章