Hello,
Welcome to our Microsoft Q&A platform!
Does your emulator support adb root? If you emulator support root, you can use adb command to disable the device location
adb shell settings put secure location_providers_allowed -gps
Use following command to enable the location.
adb shell settings put secure location_providers_allowed +gps
how to execute the adb command in uitest, you can refer to this thread :https://stackoverflow.com/questions/50364672/enable-disable-wifi-using-xamarin-uitest
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.