Reputation: 3339
I want to allow users to set the GPS information on the iPhone Simulator via GUI.
But I'm not sure how to archieve this - it seems that this tool called iSimulate does this somehow by installing an own SDK. But I can't figure out how they "override" / "hack" the simulator by that.
Thanks!
Upvotes: 22
Views: 36775
Reputation: 79
Just to extend @Ortwin Gentz answer:
If you need further config of every gps point in your gpx file. Take a look at this page:
http://www.topografix.com/gpx_manual.asp
It tells you exactly how you can provide further details like speed and height of a specific point.
Upvotes: 0
Reputation: 7361
The iOS Simulator has full location simulation built in. From the "Debug" menu, you can explore your various location options.
Original answer posted while under NDA.
Check out the bottom right entry on this page. I'm under the NDA so I can't say anything except that it has saved me significant gas money. :)
1: http://developer.apple.com/technologies/ios5/
Upvotes: 12
Reputation: 54151
Added a second answer since there are now integrated features in Xcode (≥4.2). There are two ways to simulate location updates:
<wpt>
tags only:<?xml version="1.0"?> <gpx version="1.1" creator="Xcode"> <wpt lat="47.52789018096815" lon="7.385249894876031"></wpt> <wpt lat="47.52720984945248" lon="7.382647784661411"></wpt> ... </gpx>
Upvotes: 48
Reputation: 692
In Xcode 4.2 we can simulate . There is a location symbol on the debug area (while you run the app). There are some predefined locations . Also we can add new GPX files
Upvotes: 4
Reputation: 54151
You might wanna check out my FTLocationSimulator at http://github.com/futuretap/FTLocationSimulator
It reads a KML file generated by Google Earth to provide continuous location updates. It also updates the blue userLocation dot in a MKMapView with the simulated location updates.
Upvotes: 7
Reputation: 84338
As far as I know, iSimulate is not employing any hacks. It is code that runs within your app on the Simulator which communicates with a device over the network. When it receives messages from the device (touches, GPS, acceleration) it simulates those events by calling your app's code as though the system had triggered them.
For example, to receive GPS location updates you must create an instance of CLLocationManager and then configure one of your classes to be its delegate. Well, on the iPhone Simulator you can instead start code that sends fake messages to your delegate instead. If you just call a delegate's method like this:
[delegate locationManager:nil didUpdateToLocation:newLocation fromLocation:oldLocation];
Your code won't have to know that the location update is fake. If you want to get fancy, you could create a new class that implements all the public methods of CLLocationManager but which sends fake messages instead. (Since Objective-C is dynamically typed, it won't need to be a subclass, as long as it responds to all the messages you send.)
As a side note, you can use these compiler macros to keep code simulator-only:
#if TARGET_IPHONE_SIMULATOR
locationManager = (id)[[MyFakeLocationManager alloc] init];
#else
locationManager = [[CLLocationManager alloc] init];
#endif
Upvotes: 12
Reputation: 6066
Hy stephanos,
The information of the GPS cannot be changed. It is protected and I don't believe that iSimulate can change it.
As far as I know, iSimulate is a tool to send commands from a device to the iPhone simulator, like accelerometer, touches, orientation, etc, including the current GPS location.
The SDK of iSimulate works with the app. You have to install the app in the device and add the sdk to your project, so you don't need to buld and run your app to the device all the time that you would be doing normally.
Cheers,
VFN
Upvotes: 0