question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium 1.8.0 does not use specified Android appActivity to bring application to front

See original GitHub issue

The problem

Appium does not use appActivity I specified in desired caps to bring application from background, always uses .activity.MainActivity instead.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.8.0
  • Desktop OS/version used to run Appium: Linux x86-64
  • Mobile platform/version under test: Android 6.0.1
  • Real device or emulator/simulator: Samsung Galaxy S5
  • Appium CLI or Appium.app|exe: Appium Desktop 1.6.0

Details

The application I am testing has specified different activity as launcher. I already specified appActivity: .activity.setup.WelcomeActivity in desired capabilities and indeed this activity is properly used when starting application. But calling driver.background_app() I get “The permission to start ‘.activity.MainActivity’ activity has been denied.Make sure the activity/package names are correct.” error when driver tries to bring application back to front (I am using Python client but this should not be relevant here).

Link to Appium logs

https://gist.github.com/zgoda-mobica/bb8e158a9db003de6e6ad4134fa2c942

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, May 9, 2018

the improvement has been merged to appium@beta

1reaction
mykola-mokhnachcommented, May 8, 2018

Actually, yoy can try a workaround even with the current build. Just call background with -1 duration to leave the app there and then call activateApp with the actual application id in order to restore it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appium Native app throws - Returned value cannot be ...
Hi, while trying to automate native app for android, I'm facing the following ... element could not be located on the page using...
Read more >
Desired Capabilities - Appium
Appium will attempt to install this app binary on the appropriate device first. Note that this capability is not required for Android if...
Read more >
Want to take application back in foreground - Appium Discuss
Hi, I have 2 applications. I want to perform some activity on first application. Move the first application in background.
Read more >
I'm unable to set package and activity in the appium
In the new version of Appium exe app, the app activity and package are identified by Appium to make ... Using AndroidDriver<WebElement> to...
Read more >
Getting app back to life from background - Appium Discuss
Unlock/Active the phone and run again (from last acitivity) app to foreground. I have tried with Thread.sleep (yes I know it is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found