After reading post and trying I am still not able to click on Allow permission button.
capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,“true”);
Using
Client - 6.1.0
Appium Server - 1.8
I get the below in logs
e[36minfoe[39m: [debug] Error: abcd/.MainActivity never started. Current: com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1314:12)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1258:7)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
at ChildProcess.exithandler (child_process.js:742:7)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
Also @Aleksei Does Capability order impact? I have current now defined…
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.FULL_RESET,“true”); FEW Capabilities… defined an at end I have the grant permisssion
capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,“true”);
Did you try to launch permission activity in package installer?
I think you can launch it via adb. I wonder what command issued to launch the activity.
Thanks @KazuCocoa
R u refering too
capabilities.setCapability(“appWaitActivity”, “.permission.ui.GrantPermissionsActivity”);
I did try this as mentioned by @Aleksei in one the links but did not work I have Android 6.0 at my end.
I will look into the links that u have shared.
@vsharma order = no matter. Check appium logs to see adb command that grands all permissions to your app. You can execute it manually, check how it works and maybe share here.
Hi @KazuCocoa
I added the below in the capability section what I saw in logs
capabilities.setCapability(“appWaitPackage”,“com.google.android.packageinstaller”);
capabilities.setCapability(“appWaitActivity”,“com.android.packageinstaller.permission.ui.GrantPermissionsActivity”);
Kept rest same
FULL_RESET,“true”
AUTO_GRANT_PERMISSIONS,“true”
Then I added click event for Allow button and it worked.