查看模拟器序列号
>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
版权声明:本文为ppdouble原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。