代码很简单不过会输出很长一段接近400行
adb shell dumpsys location
可以写进文本方便查看
adb shell dumpsys location > D:\gps\gps.txt
文本内容也多不好查看建议用type命令查看关键内容
type D:\gps\gps.txt | findstr location=Location[network
type D:\gps\gps.txt findstr location=Location[gps
这是里面包含经纬度的信息
也可以写成一个脚本自动生成保护经纬度信息的文本
写进文本改为bat脚本运行即可生成两个文件
一个保护全部信息(gps.txt)一个包含经纬度信息(gpslite.txt)
adb shell dumpsys location > gps.txt
type gps.txt | findstr location=Location[network >> gpslite.txt
type gps.txt | findstr location=Location[gps >> gpslite.txt