Appium inspector resets permissions for app on Android

When I start Appium inspector on Windows 10 for Android 10, my App shuts down and restarts with reset permissions, that is it asks me if the app needs access to camera, video, location, etc though these permissions were already given. It also removes the license file from my app. Any idea why this happens? Following are my Desired capabilities:

{
    "platformName": "Android",
    "platformVersion": "10.0",
    "deviceName": "R52N20ALVDN",
    "udid": "R52N20ALVDN",
    "appPackage": "Nap.CP.Android",
    "automationName": "uiautomator2",
    "appActivity": "crc6429e3927486beccbc.ActivityLicenseBrowse"
}

The uiautomatorviewer works fine. I tried changing the activity from:

"appActivity": "crc6429e3927486beccbc.ActivityLicenseBrowse"

To:

"appActivity": "crc6429e3927486beccbc.ActivityLogin"

And got the following error:

Error

An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘Nap.CP.Android’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\skhandekar\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R52N20ALVDN shell am start -W -n Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin -S’ exited with code 255’; Stderr: ‘Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin } from null (pid=31202, uid=2000) not exported from uid 10286 java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=Nap.CP.Android/crc6429e3927486beccbc.ActivityLogin } from null (pid=31202, uid=2000) not exported from uid 10286 at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1447) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:978) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:732) at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:2072) at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:646) at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1893) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:4269) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:513) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:172) at android.os.ShellCommand.exec(ShellCommand.java:104) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:12424) at android.os.Binder.shellCommand(Binder.java:916) at android.os.Binder.onTransact(Binder.java:790) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5475) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3426) at android.os.Binder.execTransactInternal(Binder.java:1056) at android.os.Binder.execTransact(Binder.java:1029)’; Code: ‘255’

And it again resets the permissions as before in addition to giving above error.

Inspector was working fine when I tried it at my workplace but failure showed up when I tried the same from home, though other than the network ie wi-fi at home, nothing has changed. The Desired capabilities were also the same.

about reset: check https://appium.io/docs/en/writing-running-appium/caps/ and change ‘noReset’ to ‘true’.

It is already set to ‘true’. Here are my serenity appium properties

#webdriver.timeouts.implicitlywait = 1000
#Note: Commented out ‘implicitlywait’ to avoid use of implicit wait in conjunction with explicit wait
#TODO: Check stability of TP run; what is default behavior when implicitlywait is not set?

webdriver.driver = appium

appium.platformName = Android

appium.platformVersion = 10.0

#Replace deviceName and udid with your S6 Tablet’s Serial Number
appium.deviceName = R52N20AMQMY
appium.udid = R52N20AMQMY

appium.hub = http://127.0.0.1:4723/wd/hub
#appium.url = http://127.0.0.1:4443/wd/hub

#appium.systemPort = 8205

appium.appPackage = Nalu.CP.Android

appium.automationName = uiautomator2

#appium.appActivity = md5943e8bc44609f7ff612d6ac75f507b3d.ActivityLicenseBrowse
#appium.appActivity = md581ec75973e0b97f2dfd0a5656e9f1c4d.ActivityLicenseBrowse
appium.appActivity = crc6429e3927486beccbc.ActivityLicenseBrowse

#appium.app = D:\Nalu.CP.Android_763.apk

appium.noReset = true

#appium.dontStopAppOnReset = true

appium.resetKeyboard = true

appium.unicodeKeyboard = true

ok. try add ‘fullReset’ = false for sure

1 Like

Thank you so much! That worked!!