How to set location at the run-time(While executing Appium Script in pcloudy devices)?
Posted on March 27, 2019
By Sridatta Pani
Code Snippet
Object deviceId = driver.executeScript("pCloudy_executeAdbCommand", "adb devices");
Object mockLocation = driver.executeScript("pCloudy_executeAdbCommand", "adb -s "+deviceId+" shell appops set com.pcloudy.services android:mock_location allow");
double latitude = 28.585895;
double longitude = 77.313255;
Object setLocation = driver.executeScript("pCloudy_executeAdbCommand", "adb -s "+deviceId+" shell am startservice --user 0 -n com.pcloudy.services/.rockr --ei op 0 --es lat "+latitude+" --es lon "+longitude);