adb常用命令

安装APP

>adb install com.android.chrome_81.0.4044.117_404411700.apk
Performing Streamed Install
Success

获取包名

Mac

adb she1l dumpsys window windows | grep mFocusedApp

Windows

>adb shell dumpsys window windows | findstr mFocusedApp
  mFocusedApp=AppWindowToken{b8b7f7c token=Token{123c66f ActivityRecord{ef3d54e u0 com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity t18}}}

其中:
●包名为:  com.android.chrome

●界面名为: org.chromium.chrome.browser.ChromeTabbedActivity

启动APP打开指定界面

>adb shell am start -W com.android.chrome/org.chromium.chrome.browser.settings.SettingsActivity
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.android.chrome/org.chromium.chrome.browser.settings.SettingsActivity }
Status: ok
Activity: com.android.chrome/org.chromium.chrome.browser.settings.SettingsActivity
ThisTime: 2961
TotalTime: 2961
WaitTime: 2989
Complete

相关推荐