How to Find Package Name and Activity Name of an Application?
Introduction
Hi everyone! đ This article will help you to find package and activity name of an android application. There are 2 simple ways to reach that information easily. Also, there are suggestions and tips to find that data from the shortest way. Check for the article and see if you have used these ways to find your appâs information.
Two Best Ways to Find Appâs Activity and Package Name
You may need applicationâs package and activity name for a lot of cases. For example, while youâre using test scripts in most cases Appium launches the app first and then performs some actions on it. For launching your application in automation, package name and activity name should be provided. You might need that information for other tests, and you might need the package and activity name for another different reasons.
Here are 2 simple ways to find your apps package and activity name:
1. Using ADB to Get Current Focus of the Screen
Firstly, you should verify your device connection with âadb devicesâ command from the command promt.
Then run âadb shellâ command.
Next step is running dumpsys window displays | grep -E âmCurrentFocusâ command.
See the picture above, the first part is package name, and the second part is appâs activity.
This method works for most of the cases. But in some conditions even though you found the app activity, the launcher activity of your app might not be the one with the current focus and you should catch the launcher activity really quick by running currentfocus command while launching your activity. Also, you can try the second way đ.
2. Using Apk Info App to Find the Package Name and Launchable Activity of Application
Download Apk Info app from Huawei AppGallery on your device and install. Check the screenshots below to find the package name and activities of your app.
You can see the package name in app details. Scroll down and find the activities part.
From activities part, mostly the first activity name is the launcher activity of your app but also that isnât certain.
So, you can also check the activities ends with MainActivity, SplashActivity, LauncherActivity etc. That was the second way to retrieve your appâs data đ.
Conclusion
I hope these ways help you find your appâs information. 2 possible ways have been explained in this article to find your appâs activity and package name without too much effort. You can use both adb to get current focus of screen and apk info app to find the app details you need.
I hope, you found this article helpful and if you have any comments or questions, please let me know in the comments below. If you know another way to find appâs information, please share it in the comments so you can also help other people to resolve their issues.