ios 学习

iOS 修改手机GPS 定位

2018-12-03  本文已影响48人  LYDeveloper

1、需要设备
iphone手机非越狱
xcode
数据连接线
2、新建一个xcode 工程。cmd+N新建一个 gpx文件。
gpx文件:

<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
    
    <!--
     Provide one or more waypoints containing a latitude/longitude pair. If you provide one
     waypoint, Xcode will simulate that specific location. If you provide multiple waypoints,
     Xcode will simulate a route visiting each waypoint.
     -->
    <wpt lat="39.979366" lon="116.30400">
        <name>Cupertino</name>
        <!--
         Optionally provide a time element for each waypoint. Xcode will interpolate movement
         at a rate of speed based on the time elapsed between each waypoint. If you do not provide
         a time element, then Xcode will use a fixed rate of speed.
         
         Waypoints must be sorted by time in ascending order.
         -->
        <time>2014-09-24T14:55:37Z</time>
    </wpt>
</gpx>

其中:<wpt lat="39.979366" lon="116.30400">是经纬度信息。

注意: 经纬度坐标
高德地图:https://lbs.amap.com/console/show/picker
百度地图:http://api.map.baidu.com/lbsapi/getpoint/index.html
3、 点击 Edit Scheme

image.png
将刚刚新建的gpx文件add进去。
4、真机运行,现在的手机定位就是刚刚修改的坐标。
上一篇 下一篇

猜你喜欢

热点阅读