How to get launcher Activity of android package

For appium/android automation testing, the Launcher activity is one of DesiredCapabilities to setup initialize  running step. so below is way that use adb command to find it.

From command line/terminal, type command(com.android.launcher3 is package name)

  • adb shell dumpsys window windows | grep -i com.android.launcher3 (MAC/LINUX)
  • adb shell dumpsys window windows | findstr com.android.launcher3 (WINDOWS)

activityname

 

For more solutions, please find at: http://stackoverflow.com/questions/12698814/get-launchable-activity-name-of-package-from-adb

The other way:

  • open the application you want to get activity
  • open command line/terminal and type command below:

adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp' (MAC)

adb shell dumpsys window windows | find "mCurrentFocus" (WINDOWS)

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.