安卓 位置模拟收集
查看模拟器序列号
adb devices
List of devices attached device
emulator-5554
然后用adb emu命令执行设备的console命令geo fix
adb -s emulator-5554 emu geo fix 121.49612 31.24010
参考:
http://code.metager.de/source/xref/android/4.2/system/core/adb/commandline.c
http://developer.android.com/guide/topics/location/strategies.html#MockData
http://stackoverflow.com/questions/2279647/how-to-emulate-gps-location-in-the-android-emulator
http://developer.android.com/tools/debugging/ddms.html#ops-location
https://github.com/dpdearing/android-gps-emulator
http://stackoverflow.com/questions/7149432/unit-testing-location-service
http://stackoverflow.com/questions/8573488/android-functional-test-send-geo-location-to-emulator
1.用geo命令模拟发送GPS信号:
geo fix 经度 纬度
即相当于将手机移动到指定的经纬度
也可以用geo nmea模拟发送nmea内容
对于“夜神模拟器”还支持通过"adb shell"命令方式修改虚拟定位,示例命令如下:
view plaincopy to clipboardprint?
将夜神模拟器的GPS定位修改为(108.958425, 34.224318),西安大雁塔的GSP坐标
adb shell setprop persist.nox.gps.latitude 34.224318
adb shell setprop persist.nox.gps.longitude 108.958425