Programmatically update GPS Coordinates

I uses to be able to update GPS Coordinates using the below, but it no longer works.

String strLocation = “-81.5812 28.41936”;
String strDeviceName = (String)androiddriver.getCapabilities().getCapability(“deviceName”);
try{Runtime.getRuntime().exec("/Users/"+strAutomationUser+"/Library/Android/sdk/platform-tools//adb -s “+strDeviceName+” emu geo fix "+strLocation);}catch(Exception e){}

Has anyone figure out a method to update Location?


Could you expand upon this a bit? What OS are you testing? I think this only works on Simulator, is that what’s broken? What version of Appium did this work with (to the best of your recall) and what version did it break on? Any more details? Any logs?


Thanks for your reply, I actually think it’s working correctly.

I think the issue is in our application.

Do you happen to know if there is a way to change the Coordinates of IOS device or Real Android device.

I don’t believe that it’s possible to change the location on a real device (happy to be corrected if I’m wrong though). I do know that you can do this for an iOS Simulator or an Android Emulator.