How to get the device name, version and Android app details

To automate the Android app, we should know below capability values.

  1. deviceName
  3. appPackage
  4. appActivity

You can get version and device name from About Device section in Settings of your phone.

about device in Android phone

about device in Android phone

If you have installed the app on your phone, you can use below commands to find out the package and main activity of app. Ensure that you are on home screen of your app

adb devices
adb shell
dumpsys window windows

Here is the sample screenshot of above commands.

adb commands to find the app package and activity

adb commands to find the app package and activity

Or you can also use APK Info app (Intelloware) to get information about other apps.

Here is the sample code snippet using above capabilities

capabilities.SetCapability("VERSION", "4.4.4"); 
capabilities.SetCapability("BROWSER_Name", "Android");
capabilities.setCapability("appPackage", "org.softpost");
capabilities.setCapability("appActivity", "org.softpost.AbcActivity");

You may also like...