notes/ADB Android Shell GPS Location-Zmf3hVR7.sh
#Get GPS Location from android phone
#If no program is checking the location (example: Google Maps) then the location won't update
#while [ 1 ];do adb shell dumpsys location |grep 'gps: Lo'|awk '{print $3}';done
while [ 1 ];do adb shell dumpsys location |grep -A1 'Last Known Locations:'|tail -n 1|awk '{print $3}';done
#if you haven't set permissions for accessing ADB you might need to use 'sudo'
sudo killall adb
#while [ 1 ];do sudo adb shell dumpsys location |grep 'gps: Lo'|awk '{print $3}';done
while [ 1 ];do sudo adb shell dumpsys location |grep -A1 'Last Known Locations:'|tail -n 1|awk '{print $3}';done
syntax highlighted by Code2HTML, v. 0.9.1