且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何模拟GPS位置在Android模拟器?

更新时间:2022-03-06 01:08:38

您可以连接到通过Telnet仿真器。那么你有一个仿真器控制台,可以让你输入特定的数据,如地理修复,网络等。

You can connect to the Emulator via Telnet. You then have a Emulator console that lets you enter certain data like geo fixes, network etc.

如何使用控制台被广泛这里解释。 要连接到控制台打开命令行并键入

How to use the console is extensively explained here. To connect to the console open a command line and type

telnet localhost 5554

您则可以使用地理命令设置纬度,经度,如果需要高度传递到使用GPS的位置信息提供的所有程序在设备上。见上面的详细说明的链接。

You then can use the geo command to set a latitude, longitude and if needed altitude on the device that is passed to all programs using the gps location provider. See the link above for further instructions.

具体的命令在控制台中运行的

The specific command to run in the console is

geo fix <longitude value> <latitude value>

我发现这个网站寻找一个现实的纬度/液化天然气有用: http://itouchmap.com/latlong.html

如果你需要更多的那么一个坐标,你可以使用KML文件的路径,以及它在这个描述一点点的文章。我找不到此刻更好的来源。

If you need more then one coordinate you can use a kml file with a route as well it is a little bit described in this article. I can't find a better source at the moment.