Wednesday, 22 November 2017

Identify your Device, Package and Activity Name

Device , package and activity names etc are required to initiate Android Driver instance as Desired capabilities.

Device Name is required to connect the device.
Package and activity names are required to connect the APK.

We can get Device, package and activity names from ADB, Android Debug Bridge, which is a command-line utility included with Google's Android SDK.
If you don't have Android SDK tools and packages installed please refer POST  Appium - Install SDK tools and packages

Please connect your android device and make sure USB debugging is enabled. Enable Developer Options in Android

Device Name
Open cmd prompt and run the below command

adb devices
*Note: if Android path is not setup then please navigate to the android_sdk\platform-tools



Package and Activity Name
Run below command

adb shell


adb dumpsys window windows | grep -E ‘mCurrentFocus|mFocusedApp’
*Note: Please make sure that before running the above command your phone must be unlocked and desired application is open.



Other way to get Package and Activity Name:

  1. Go to Android Play Store > Download and Install APK Info application

     
  2.  Search the desired application and long press on it.

     
  3. Long presssing the selection, opens the Detailed Information popup > go to Detailed Information.
     

     
  4. Look for APK path
     

  5. Look for Activities
     

No comments:

Post a Comment