App Package name & App Activity name is required when we are doing automation for a particular app.
For example, if we want to automate dialer app using APPIUM (which I will be covering in upcoming posts) , then you need to have app package name & app activity.
Method 1: By using adb command
This is how we can have app package name and app activity
Fig 1. Select the Dialer app and launch |
Fig 2. Dialer App launched |
adb shell
shell@LS-5016:/ $dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
Below will be output on the command prompt
Method 2 : By Using aapt dump badging command
For this method, I have considered Amazon app. First we have to place the apk at given path C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\28.0.3
Later we can run below command at command prompt
C:\..\AppData\Local\Android\Sdk\build-tools\28.0.3>aapt dump badging "C:\Users\Administrator\AppData\Local\Android\Sdk\build-tools\28.0.3\Amazon Shopping_v18.12.0.100_apkpure.com.apk"
Fig 4. Package name using aapt |
Fig 5. App Activity using aapt |