查看模拟器序列号

>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

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐