Question: Environment:

* OS Windows 7
* Appium 1.4.16.1
* Android emulator 6.0

I need to accept any permission alerts(Android 6.0 -- sms,location and etc) automatically.

What I tried:

1. Use `driver.switchTo().alert().accept();`

Result:

`org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html`
2. Set `capabilities`:

`capabilities.setCapability("autoGrantPermissions", "true");`
`capabilities.setCapability("autoAcceptAlerts", "true");`

Result: it doesn't work

Answer: 
Just add `'autoGrantPermissions': 'true',` to your desired capabilities! 

Please note! This will auto accept all the permissions where-ever applicable and is only valid for android system permissions. This is not applicable for app customized developed permissions.
try adding capability: 
`'autoGrantPermissions': 'true',`

had the same issue, this solved it for me.