Finding Package Name, Activity Name of .apk file


Objective: Finding Package Name, Activity Name, Device Name
As you know, to start a session we need to set Desired Capabilities. Among those, we need to set Package name and Activity name capabilities as well. There are several methods to find package and activity name.
* Using Apk.info app
* By extracting AndroidManifest.xml
* By using commands in Terminal
* By using UIAutomator

If you’re using Appium GUI, then it’s quite easy to get package names by adding APK path in GUI. If you’re not using GUI then,
Let’s start with APK info. APk info is an app which provides information about your app installed in your device. You can download apk.info app from here.
From previous article you know how to install an app in your real device or emulator. You can directly install in your device using google play store and also you can install using commands. It’s up to you.

Once you install apkinfo app in the device, launch the app to view all the apps present in your device. To view package & activity names, long press on the app and click on Detailed information. Then it displays all the details of the particular app. Take a look at below image

apkinfo

In the image, you can see package name and activity name which were highlighted. Similarly you can find package and activity names of your apps

I’m not gonna talk about Manifest.xml now. We will see this in security testing sessions. Now we will try another method to get package and activity names.

Go to the path where you’ve installed SDK. Go to Build-Tools folder. Now open CLI by right clicking. Just type the command: aapt dump badging “path of your apk”. This will display all details of your app. For example:
./aapt dump badging /Users/appname.apk, take a look at below image
apt1

apt2
Now you know how to get package, activity names. Quickly we will get name of the device connected to the system. Just open Terminal and type ‘adb devices‘. This should display the connected devices. Now you’re Good to Go!

Advertisements

One thought on “Finding Package Name, Activity Name of .apk file

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 )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s