
When you write automation test scripts with Appium, the first step is almost always the same – launch the app you want to test, and then perform some actions on it. For example, let us suppose that you are testing WhatsApp. Your automation test script needs to open WhatsApp and then perform actions such as sending a message or verifying that a particular message has been received.
But here’s the catch:
How does Appium know which app to launch?
Your phone would have dozens of apps installed, so Appium needs a reliable way to identify the app.
Let us first check how you would do it manually?
If you were opening WhatsApp yourself, you’d probably either:
- Scroll through your app list and tap the WhatsApp icon or logo, or
- You could also identify the app or search for it by name – WhatsApp
Appium works in a similar way – but instead of looking for an icon or a label, it needs something more technical.
To launch an app, Appium requires two key pieces of information:
- Package name – the unique identifier for the app.
(You can think of it as the app’s full legal name, not its nickname) - Activity name – the specific screen or entry point that should open when the app launches.
Together, these tell Appium exactly where to go and what to open.

This article lists down 2 different methods using which you can find appPackage and appActivity names of your app under test. You can use any of these methods to find out the package and activity names of your app. Before we start with these 2 methods, let’s first get some more detail about appPackage and appActivity.
What is appPackage and appActivity name ?
appPackage:
In very basic terms, appPackage is the unique identifier of an Android application. This app package name uniquely identifies the app within the Google Play Store. Due to this reason, no two apps can have the same package name.
For example, appPackage for ‘YouTube’ for Android is ‘com.google.android.youtube’. For Facebook, this name is ‘com.facebook.katana’ and for WhatsApp, the appPackage is – ‘com.whatsapp’. So if you want to launch Facebook from Appium, you would need to provide it’s name as ‘com.facebook.katana’ in Appium.
appActivity:
Again, speaking in very basic terms appActivity refers to single screen within the app that a user can interact with
For example, WhatsApp provides multiple screens/functionalities such as chats, status, calls, setting profile photo, etc. Each of these screens is represented by an appActivity.
Together with these activities, every app has a main activity which is sort of the main screen you see when you launch the app. For WhatsApp, it is the Chats screen, and for Facebook it would be the Home Screen where you see your feed. When you launch the app with Appium, it needs to know which activity has to be launched. And you would need to provide the main activity name (the activity which represents the app’s main screen)
With this basic and important understanding on about app package and app activity, let us start with the different methods with which you can identify this information of your app.
In this article, we will use the Google Play Store app as an example and find its app package name and app activity name. However, you can follow the steps given below to find these details for any app installed on your phone.
Method 1: Using ‘mCurrentFocus’ or ‘mFocusedApp’ in Command Prompt
Step 1: Unlock your mobile device and connect it to your computer using USB cable
Step 2: Open Command Prompt and run adb devices command. We are running this command to just make sure that your mobile is properly connected.
Step 3: Once you run adb devices command, you should see that it displays the list of attached devices as shown in the below image (the actual device name that you see would be different based on what mobile phone you use) –

Step 4: Run adb shell command. After running this command, the command prompt should look something like this –

Step 5: Now in your mobile phone, open the app for which you want to find the app package and app activity. Since we are doing this for Play Store, hence we will open “Play Store” on our mobile phone.

Note: Please make sure that you open the app before going to the next step, because command in the next step would provide the details only for the app which is currently in focus.
Step 6: Now run this command: dumpsys window displays | grep -E 'mCurrentFocus'
Step 7: The above command would display the details of the app which is currently in focus. From that, you can figure out the appPackage and appActivity name as per the below image –

appPackage starts with com. and ends before backshash (/). So from the above image, appPackage name is – com.android.vending
appActivity starts after the backslash (/) and goes till the end. From the above image, appActivity name is – com.android.vending.AssetBrowserActivity
Step 8: There is one more similar command that provides the appPackage and appActivity name. This command adds some additional details before and after the package name & activity name, but you can still try it out just to verify that the results from the above command are same. This command is – dumpsys window displays | grep -E 'mFocusedApp' and the output of this command is shown below –

In this example, where we used mFocusedApp, appActivity name is shown as a relative name, i.e., it doesn’t start with com. In such cases, you would need to add com…. at the beginning to get the complete activity name. So in our case, complete activity name for .AssetBrowserActivity would be com.android.vending.AssetBrowserActivity
Method 2: Using APK Info app
APK Info is an app which you can download from Play Store, and it will provide the appPackage and appActivity name of any app which is installed on your mobile device.
Step 1: Download “APK Info” app from Google Play Store on your android mobile.

Step 2: Once you have successfully installed APK Info app, open it and check that it lists down all the apps that you have on your phone. Then search for “Google Play Store” in the search pane as shown below

Step 3: Long press on the “Google Play Store” application icon inside the APK Info app till it displays the list of options as shown below –

Step 4: Click the option “Detailed Information” option. It would show the detailed log for the app.
Here, check the APK path section. This sections displays the “appPackage” name as highlighted in red block in the below image –

Note: Skip any number at the postfix of the name (eg: here its “-2”). So, the appPackage name in this case is – com.android.vending
Step 5: Then to find the appActivity name of the app, scroll down to the sub-section “Activities”. This sub-section displays all the activities that are available for the app. From this list, you have to look for the activity which has “MainActivity” or “Main” or “Login” in the activity name.

Here “com.google.android.finsky.activities.MainActivity” is the appActivity name for the Play Store app.
Since Play Store is a full fledged app, so it contains a lot of activities. However, if you are testing a small app or some app which is in development phase, then it would not contain these many activities. So it would be easier to identify the main activity in that case. If you still find it difficult to identify the main activity, then you can always check back with your developers or use the first method that we have provided in this article.
With this, we complete our article on identifying appPackage and appActivity name for the app you want to test. Let us know if you face any issues while identifying these properties of any particular app with these methods. We would also love to hear from you, if you have any feedback for us, or if you have any other way which can help identify these properties.
We are continuously adding more articles to our tutorial series. You can check it out here – Appium Tutorials