【android adb命令行模拟GPS位置信息】
•
移动开发
adb命令查询已连接设备
adb devices
显示结果:
List of devices attached
smartdevhub.ecarx.com.cn:8225 device
使用adb命令获取GPS信息
adb shell dumpsys location
打开定位设置界面:
adb shell am start -a android.settings.LOCATION_SOURCE_SETTINGS
开启定位:
adb shell settings put secure location_providers_allowed +gps
关闭定位:
adb shell settings put secure location_providers_allowed -gps
查看定位方式:
adb shell settings get secure location_providers_allowed (前提是位置信息开启)
修改gps定位信息
使用adb emu命令执行设备的console命令geo fix,gps的经度和纬度
adb -s emulator-5554 emu geo fix 121.49612 31.24010
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/1b7d216def.html
