How to identify an Android APK’s package and activity name?

In order to start the Android mobile application automation using Appium, you need to get the target APK’s package name and activity name to invoke the application in the real device or emulator. Package name and activity name should be mentioned in the desired capabilities section associated with the coding section in IDE.

Please find the below ways to get the package name and activity name;

  • Using adb Shell Command (Get Package & Activity)

Run the below ADB command in command prompt after opening the target mobile application in the phone or emulator;

c:\users\gkannan> adb shell “dumpsys window windows | grep –E ‘mCurrentFocus’”

shellpaytm12.

  • Using adb logcat (Get Package & Activity)

Run the below command in command prompt, open the target application and stop the logcat generation using Ctrl+C;

c:\users\gkannan> adb logcat

paytm2

  • Using uiautomatorviewer.bat from Android SDK(Refer tools folder) (Get Package)

Capture screenshot of the target mobile application using uiautomatorviewer and analyze the package name as specified in the below screenshot;

paytm3

  • Using Appium Inspector from Appium Server (Get Package)

Capture screenshot of the target mobile application using Appium Inspector and analyze the package name as specified in the below screenshot;

paytm4

  • Using APK Info utility available in Google Play store (Get Package & Activity)

Download the “APK Info” mobile application from play store using the below URL; Search for the target application in the filter search control, long press the target application and select the “Detailed Information” option. Scroll down to the Activities section and get the first three periods as package name and complete list as an activity name;

https://play.google.com/store/apps/details?id=com.intelloware.apkinfo&hl=en

apkinfo5

  • Using Appium Server Parameter Configuration

Appium Server will automatically display the package name and activity name of the target application once the apk file mapped in the app path as follows;

paytm6

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 )

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