How to Get Android App Package and App Activity for Appium Testing?

We have discussed all the basic steps to launch our mobile automation project with Appium. Now we are in the phase where we need to build Appium tests for Hybrid or native app or mobile web app as well. We need details of Android app package and App activity to test hybrid and native app. So the agenda of this article is helping you in getting Android app package and App activity to initialize your test operations on Hybrid and native mobile app.

Let’s have a look at some of the best Appium suggestions for you before we jump to an in-depth discussion on Android App package and App Activity:

What is Android App Package?

An Android app package is a .apk file by which Android operating system distributes and installs the Android application and its middleware.

APK file or app package is analogous to software packages of other platforms like .exe file, APPX file, etc.

What is Android App Activity?

Android app activity is the screen of the Android app. It’s a kind of a window, like Microsoft windows OS for Laptop or desktop device. It has the Main screen and from here we can jump to any other screens for performing different activities.

Android Activity Lifecycle Android App Package

How are Android App Package and Android App Activity important for Appium testing?

Android App package is the destination of your apk file or installed file in your Android device, whereas Android App Activity is the destination path of the screen which will be launched by Appium server.

We give the name of that screen through Android App Activity at which we are going to perform the testing activities. After setting all the capabilities, Appium first launches the app through the app package, then it navigates to the desired screen through Android app activity path.

How to get Android App Package and Android App Activity details of any Android App?

There are various ways to get these details; but, here I am going to tell you the easiest and efficient ways to collect app package and app activity details. Let’s start with command line technique.

1. By using the command line

This is one of the handiest techniques. Follow the steps below to get the App package and app activity details.

Step #1: Open Testable App in your Device

Suppose I need App package and app activity details of calculator main page.

Testable App

Step# 2: Open command prompt

Open command prompt and type following command one by one.

adb devices
adb shell
dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'

After execution of the above commands, you get the required details.

Android App Package Android App Activity details

From the above image, we found the below details:

Android App Package: com.android.bbkcalculator

Android App Activity: com.android.bbkcalculator.Calculator

2. By Using APK info app

Download APK info app from Google play store. Install and launch the app. Get the details as per the image below.

Click here to download APK info app.

Apk info app

Hope the above tutorial will help you in getting an info related to Android App Package and Android App Activity. Share your thoughts via the comment form below.

Join Inviul fb group

Leave a Reply