How to set fake GPS location on IOS real device

后端 未结 9 860
盖世英雄少女心
盖世英雄少女心 2020-12-08 04:02

Currently I have to test app and set the different fake GPS locations on real IOS 7 devices. On Android I use \'My Fake Location\'. Unfortunately, I didn\'t find the same ap

相关标签:
9条回答
  • 2020-12-08 04:39

    There are one solution for fake GPS in ios simulator and real device. we can use GPX file for fake GPS and simulation.

    I followed the step by step guidelines of GPX file use in Xcode with simulation. Here is full step by step guidelines of GPX file use. And also you can download the GPX file Demo from github.

    0 讨论(0)
  • 2020-12-08 04:41

    you can do it on real device by run device in Debug mode

    Click Debug->Simulate Location -> add .gpx file for your location during run time

    0 讨论(0)
  • 2020-12-08 04:43

    I had a similar issue, but with no source code to run on Xcode.

    So if you want to test an application on a real device with a fake location you should use a VPN application.

    There are plenty in the App Store to choose from - free ones without the option to choose a specific country/city and free ones which assign you a random location or asks you to choose from a limited set of default options.

    0 讨论(0)
  • 2020-12-08 04:48

    Of course ios7 prohibits creating fake locations on real device.
    For testing purpose there are two approches:
    1) while device is connected to xcode, use the simulator and let it play a gpx track.

    2) for real world testing, not connected to simu, one possibility is that your app, has a special modus built in, where you set it to "playback" mode. In that mode the app has to create the locations itself, using a timer of 1s, and creating a new CLLocation object.

    3) A third possibility is described here: https://blackpixel.com/writing/2013/05/simulating-locations-with-xcode.html

    0 讨论(0)
  • 2020-12-08 04:50

    When running in debug mode you can use the little arrow button in the debug area (Shift+Cmd+Y) in Xcode to specify a location. There are some presets or you can also add a GPX file.

    Specify debug location

    You can generate GPX files here manually: http://www.bikehike.co.uk/mapview.php (from answer: https://stackoverflow.com/a/17478860/881197)

    0 讨论(0)
  • 2020-12-08 04:53

    Create a .GPX file with xcode, then specify your coordinates and when your device connected, hit the little arrow button and select your .GPX file. You can create multiple files and add lots of coordinates to single .GPX file in order to make some kind of route.

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