06 Apr 2017

Appium – Getting android appPackage and appActivity

Appium, Testing 0 Comment

              While launching an application using Appium, it is required to have the appPackage and appActivity to set the Desired Capabilities. Earlier it used to be a long and tedious task to get these details from the APK file but now there are multiple easy ways to find this information.


  1. Using APK info android app
  2. Using command prompt
  3. Using logcat In Command Prompt
  4. Using AndroidManifest.xml

Appium itself:

The best and the easiest way to find the appPackage and appActvity is from the Appium itself. Before that, you need to start your Appium client.

1) Start the Appium client. A Below mentioned window will display, Once you started the Appium client.

2) Click on the android icon marked above to open the configuration settings.

3) Check the Application Path check box.

4) Click on Choose button to locate your apk file, in this case, I have given it Flipkart.apk file.

Note: In case the correct information is not displayed in the Launch Activity field, click on the dropdown to look for the home.Home.Activity. Or if the information is not even there, try using the another way’s to find the information

Using APK info android app

Step 1: Just Download APK info app from AppStore

Once you downloaded the APK info app, Open the app

From there you will see android app’s which you are installed in your device, Just long press on the app which you want to get appPackage and appActivity.

Tap upon “Detailed Information”, there will see appPackage name and appActivity name


appPackage name: com.facebook

appActivity name : com.facebook.katana.LogoutActivity

Note: We have so many activities on a mobile app, So make sure if you want to perform particular mobile interface(Screen) then choose that activity on APK info app.

Using command prompt

Get Package Name:

  1. Connect your android phone to PC and turn on USB debugging mode.
  2. Open Command prompt.
  3. Run command ” adb shell pm list packages -f “

  1. It will show you a list of apps(Which are installed in your device) with a package name.
  2. Find your app from the list. It will show you package name.

Using logcat In Command Prompt

  1. Connect your android phone to PC and turn on USB debugging mode.
  2. Open Command prompt.
  3. Run command  “ adb logcat “.

  1. Open app on the android phone. Immediately press CTRL + C in command prompt to stop logging in command prompt.
  2. Android phone’s latest activity will be logged in command prompt.
  3. If you see in the log, It will show you app launcher log.

If you want specific appActivity and appPackage on a particular mobile interface (mobile screen):

On command prompt, type below commands

  1. adb devices  — it show’s how many devices connected to your PC/laptop
  2. adb shell
  3.  dumpsys window windows | grep -E ‘mCurrentFocus|mFocusApp’ .

Then you will get appPackage and appActivity.

For example on command prompt

appPackage : com.android.mms

appActivity : com.android.mms.ui.ConversationList

Using AndroidManifest.xml

  1. Every .apk file contains AndroidManifest.XML file which contains android app’s package and activity name


  1. .apk file for which you wants to get package and activity name.
  2. WinRAR should be installed in your PC.
  3. Right click on the .apk file of APK Info app(or any other .apk file for which you wants to know package and activity name).
  4. Select Open with -> WinRAR archive option from right click context menu.

5. It will open the .apk file in WinRAR window and you can see AndroidManifest.XML there as shown in bellow image.

6. Open AndroidManifest.xml file in notepad.

7. Now find keyword “p a c k a g e” In notepad. It will show you package name of your app.

8. Find keyword “a c t i v i t y” In notepad. It will show you activity name of your app.

I am sure the above different ways of finding APK information, one would definitely work successfully to you.

Thank you for reading this article!