1

There is method to get current activity in AndroidDriver:

driver.currentActivity()

which returns string like .MainActivity without package name. Is there any way to get full activity name or application package separately?

artkoshelev
  • 872
  • 7
  • 22

3 Answers3

1

Unfortunately, it's not yet possible.

Because Appium is using Selenium WebDriver, WD protocol should be extended / modified for that.

geiger
  • 722
  • 7
  • 12
0

This method driver.currentActivity() to get current activity based on the current page.

Use .getCapabilities() to get package name and activity name:

//return package name
driver.getCapabilities().getCapability("appPackage").toString();
//return activity name, as generic (not based on current page)
driver.getCapabilities().getCapability("appActivity").toString();

Reference : Docs

frianH
  • 7,295
  • 6
  • 20
  • 45
-1

You can fire ADB Command from your code Like: adb shell cd data/app ls

Or do it programmatically

Community
  • 1
  • 1