How to emulate GPS location in the Android Emulato

2018-12-31 02:23发布

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 a test position?

30条回答
与风俱净
2楼-- · 2018-12-31 02:59

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

查看更多
人气声优
3楼-- · 2018-12-31 03:00

I was trying to set the geo fix through adb for many points and could not get my app to see any GPS data. But when I tried opening DDMS, selecting my app's process and sending coordinates through the emulator control tab it worked right away.

查看更多
路过你的时光
4楼-- · 2018-12-31 03:01

See Obtaining User Location

Look under Providing Mock Location Data. You will find the solution for it.

查看更多
高级女魔头
5楼-- · 2018-12-31 03:02

No one here mentioned the built in solution of the emulator itself, so for future visitors, I'd like to share it with visuals.

First, run your Android Emulator and click on the menu button (3 dots) shown below:

emulator with menu button

Then from the left pane, select Location and change the coordinates according to your needs. After pressing Send button, changes will immediately take effect (I recommend you to open up Google Maps for better understanding).

enter image description here

Android Studio Version: 2.3.3

查看更多
闭嘴吧你
6楼-- · 2018-12-31 03:02

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

查看更多
怪性笑人.
7楼-- · 2018-12-31 03:04

If you're using Eclipse, go to Window->Open Perspective->DDMS, then type one in Location Controls and hit Send.

查看更多
登录 后发表回答