2

My IOS app is location depend. I have to test the app by setting different fake GPS locations on real IOS 9.3.1 devices. I searched Fake location app but nothing worked as expected. Most of the app are related to take photo and share on fb or twitter with fake location. These app are not changing the device gps location

My client need to test the app in different location. He is able to do the same in android and expecting the same from IOS. Any idea apart from debug mode.

Is it possible to set fake location in IOS real device.

user2681579
  • 1,413
  • 2
  • 23
  • 50
  • 1
    Show how you are getting your current location. You should be able to replace that with a "fake location" to test it. – logixologist Apr 20 '16 at 20:23
  • @logixologist You mean I need to hardcode the required lat and lon on code. Client need to test the app in different gps location. Do we have any alternatives for that instead of setting in source code. – user2681579 Apr 20 '16 at 20:53
  • 1
    possible duplicate http://stackoverflow.com/q/21908356/1040347 – Aleksey Potapov Apr 20 '16 at 21:03

1 Answers1

3

You can do this if you have the device connected to the computer in debug mode through XCode. Go to Debug -> Simulate Location and select one of the pre-existing locations.

Alternatively, you can add your own GPX file to the project simulate any other custom location. Your GPX file would look similar to this, you would just need to update the latitude and longitude.

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0">
    <wpt lat="46.57638889" lon="8.89263889">
        <name>LAGORETICO</name>
    </wpt>
</gpx>

See this link for more details on how to write your own GPX file.

This link, although slightly outdated, has a great example of how to do this from start to finish.

wibs
  • 43
  • 7
  • Thanks for your reply. My client need to test the app in different location. He is able to do the same in android and expecting the same from IOS. Any idea apart from debug mode. – user2681579 Apr 20 '16 at 20:57
  • there is no app for that. In fact you could implement your own location changes (e.g. with timer update) see this answer http://stackoverflow.com/a/21910362/1040347 – Aleksey Potapov Apr 20 '16 at 21:03
  • 1
    The comment above is correct, you can't have an application update your device's location unless you are debugging. You would need to write a location simulator into your app to update your app's location manager with the points you need. – wibs Apr 20 '16 at 21:09