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’”
2.
- 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
- 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;
- 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;
- 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
- 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;