The following commands do not disable location services on API 30. Although they do work on other API levels.
adb shell settings put secure location_providers_allowed -gps
adb shell settings put secure location_providers_allowed -network
They do not throw any error message, but they do not turn off the location services either.
location_providers_allowed
is deprecated since API 19. According to the API doc it should be still present in 30 however the doc also statesDo not rely on this value being present or correct
.