SetLocation Does not work

I am trying to use the driver.setlocation method for my android emulator and can see that though it sets the coordinates, when the driver opens the application , the application does not reflect the new location.

Code is as below.

Location loc = new Location(Constants.LAN, Constants.LON, Constants.ALT);

i have the same issue

I found the same issue. I’m using setLocation exactly like in post above, but when just after that reading location to check if it was changed it’s still showing the previous one. And it’s happening only on Android 11, on previous versions it’s working correctly. Can it be something related to Android 11?

Try mockLocationApp capability for permission to io.appium.settings (mock location provider since Appium 1.18.0+) , or use adb command before test start if your client is android
“adb -s “uuid” shell pm grant io.appium.settings android.permission.ACCESS_MOCK_LOCATION”