Is there any way to simulate a location on an iOS device without having to run Xcode with gpx files to do so? I'm fluent in swift and objc and would like to make an app simulate a location without running Xcode. The down side is that when you want to simulate a location without being connected to Xcode the app does not continue to simulate the location. Any help would be greatly appreciated!
Sometimes I use a quite ugly hack to do that.
When you have your device connected to the Xcode while simulating location, just remove the lighting cable without killing an app directly.
The app will crash but when you relaunch it you will see it shows the same simualated location despite the fact it's no longer connected to the Xcode.
Note that this is not an elegant approach and to make your device location services work properly again, you have to run an app from Xcode on your device and explicitly set Debug/Simulate Location/Don't Simulate Location
Related
I have an app written in Swift 5 using Xcode 13.3.1 that has sensor reads but also a speedometer that works by using GPS which is set as a requirement in "Custom iOS Target Properties" to track speed which works great on an iOS Phone as there is cell service but I want to run the app in an iPad that is Wifi only- no cell service. When I try to run the app in Xcode using the iPad as a test device, it stops on install saying that it can not install because the iPad doesn't support GPS. I'm wondering if there is a way to disable the need for GPS in the Info Target Properties or in code, when a device that is WiFi only is attached? I'm fine with the fact that the Speedometer will not function as a result, but the sensor reads will still work.
GPS which is set as a requirement in "Custom iOS Target Properties"
That's the wrong approach. Basically using required hardware properties is frowned on. Just install anywhere, and then fail gracefully if the user tries to employ a feature that requires hardware that isn't there.
For a little project I´m trying to simulate locations on my iPhone/iPad with the existing Maps - App. With XCode on Mac, you can simulate locations with the help of a GPX-file. But is this also possible without Xcode? Can the GPX-file be saved on the iPhone and then started from there? A second option would be to create a new map using MapKit. But I actually want to use the internal Maps app.
Many Thanks!
No, unfortunatelly this is not possible. There is no way how you can save GPX-file at real device without Xcode simulator at this point.
I've been experimenting with location simulation in Xcode. Turns out, when you build a debug app with the simulation turned on, it somehow hijacks Core Location feed for every app and you won't be able to get your real location until you build the debug app with this feature turned off.
How exactly does it work under the hood? Could it be LLDB injecting some code to Core Location library?
Is there a way to do the same without Xcode?
I'd like to know whether it's possible to simulate locations in my app when testing it on a real iPhone connected to xcode(instead of the simulator) ?
It seems that it was possible via the Instruments->Automator in other versions of Xcode but this service has been removed from Xcode 8. Most probably location simulation in a real device is possible via user interface testing, but I've never done it.
I want to programatically simulate multiple locations with a delay so I'm pretty sure just a GPX file won't be enough.
I'm building an iOS 8 app that features GeoFencing. I need to test this and I know that I can emulate the location in Xcode using the preconfigured locations or providing a GPX file. However, as this app needs to act based on region monitoring when it's killed (swiped up in multitasking by user), how can I test it without getting in my car and driving around?
Thanks!