Ways to fetch appPackage & appActivity for Android apps as appium capability

qavbox by sunil
2 min readMar 21, 2023

--

Mobile device has many applications, so we should let appium know on which application automated tests should run.

For this appium provides capability appPackage and appActivity to identify the Android application on device.

Most of the applications we do automation are from with in the organisation, appPackage & appActivity from the dev team.

but if in case the dev team is not present in same organisation or you are practicing any public applications, then we do have other ways to fetch these capabilities.

appPackage & appActivity for android apps –

Method 1 –

For only windows OS –

Before proceeding to get the details, refer Appium setup for windows (Make sure you have Android SDK installed folder on your machine and environmental setup)

  • If real device, then connect to computer with debug mode ON, if simulator, then just launch the simulator
  • Launch the app and should be displayed on screen
  • Open command prompt, Start -> Run -> cmd
    Type following commands one by one
adb devices 
adb shell
dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'

From above, orange highlights is the app package and activity
io.selendroid.testapp/io.selendroid.testapp.HomeScreenActivity
App package: io.selendroid.testapp
App Activity: io.selendroid.testapp.HomeScreenActivity

Method 2 –

Independent of OS — on the mobile device or simulator

In the mobile device or simulator, install apk info app, you can download from here

  • Launch the apk info app
  • Search for the application you want to get the appPackage and appActivity
  • Long press & right click on the search result and tap on Detailed information
  • There you will get the required appPackage & appActivity

Follow qavbox for more such topics.

You can find automation testing topics on

my blog — https://qavalidation.com/

watch the testing topics — https://www.youtube.com/c/qavbox

--

--

qavbox by sunil
qavbox by sunil

Written by qavbox by sunil

QA validation tools and techniques

No responses yet