How to emulate GPS location in the Android Emulator?

前端 未结 30 2391
天命终不由人
天命终不由人 2020-11-21 22:15

I want to get longitude and latitude in Android emulator for testing.

Can any one guide me how to achieve this?

How do I set the location of the emulator to

相关标签:
30条回答
  • 2020-11-21 22:53

    I was looking for a better way to set the emulator's GPS coordinates than using geo fix and manually determining the specific latitude and longitude coordinates.

    Unable to find anything, I put together a little program that uses GWT and the Google Maps API to launch a browser-based map tool to set the GPS location in the emulator:

    android-gps-emulator

    Hopefully it can be of use to help others who will undoubtedly stumble across this difficulty/question as well.

    0 讨论(0)
  • 2020-11-21 22:53

    In Linux where communication ports are blocked. navigate the terminal to platform-tools folder inside android sdk and fire this command:

    ./adb -s #{device_name} emu geo fix #{longitude} #{latitude}
    
    0 讨论(0)
  • 2020-11-21 22:54

    I use eclipse plug DDMS function to send GPS. enter image description here

    0 讨论(0)
  • 2020-11-21 22:56

    If you're using Android Studio (1.3):

    • Click on Menu "Tools"
    • "Android"
    • "Android device monitor"
    • click on your current Emulator
    • Tab "Emulator Control"
    • go to "Location Controls" and enter Lat and Lon
    0 讨论(0)
  • 2020-11-21 22:57

    First go in DDMS section in your eclipse Than open emulator Control .... Go To Manual Section set lat and long and then press Send Button

    0 讨论(0)
  • 2020-11-21 22:57

    If you are using eclipse then using Emulator controller you can manually set latitude and longitude and run your map based app in emulator

    0 讨论(0)
提交回复
热议问题