Security exception: Permission Denial while trying to open Facebook app through appium inspector

0

I am trying to start automation of facebook App. I logged out from the app and used dumpsys window windows | grep -E mCurrentFocus|mFocusedApp to get the app activity and package. I got the values as com.facebook.katana/com.facebook.account.login.activity.SimpleLoginActivity

I provide the values in the appium inspector to get locator values

{
  "deviceName": "xxxx",
  "udid": "xxxx",
  "appPackage": "com.facebook.katana",
  "platformName": "android",
  "appActivity": "com.facebook.account.login.activity.SimpleLoginActivity"
}

but I am getting the error

exited with code 4294967295'; Stderr: 'Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=com.facebook.katana/com.facebook.account.login.activity.SimpleLoginActivity } from null (pid=20151, uid=2000) not exported from uid 10206

I followed https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md to check my activity ,

C:\Users\aswathy_krishnan>adb shell am start -W -n com.facebook.katana/.com.face
book.account.login.activity.SimpleLoginActivity -S -a android.intent.action.MAIN
 -c android.intent.category.LAUNCHER -f 0x10200000

but it is giving me an error,

Error: Activity class {com.facebook.katana/com.facebook.katana.com.facebook.acco
unt.login.activity.SimpleLoginActivity} does not exist.

What am I doing wrong? I think it might be because of the appActivity, but how can i get the main activity?

android
appium
android-permissions
permission-denied
asked on Stack Overflow Feb 28, 2019 by aswathy

2 Answers

0

The exception is pretty clear: for security reason activity start is blocked.

You need to set android:exported="true" in AndroidManifest.xml file where SimpleLoginActivity is declared. I guess you don't have access to Facebook App source code to fix that.

Appium is pretty flexible tool, but if AUT has security restrictions Appium cannot do anything with it.

answered on Stack Overflow Feb 28, 2019 by dmle
0

First cross check your main activity using below link.

http://www.automationtestinghub.com/apppackage-and-appactivity-name/

If still you are getting same error then android:exported="true" should be in AndroidManifest.xml for main activity/specified activity.

answered on Stack Overflow Feb 28, 2019 by Muzzamil

User contributions licensed under CC BY-SA 3.0