tags:

views:

4259

answers:

4

Does anyone know how to set the location (as it's picked up in CoreLocation services) in the iPhone Simulator? I've been browsing online docs all day and I can't find an answer. Speak up!

+9  A: 

In my delegate callback, I check to see if I'm running in a simulator (#if TARGET_ IPHONE_SIMULATOR) and if so, I supply my own, pre-looked-up, Lat/Long. To my knowledge, there's no other way.

Ben Gottlieb
A: 

So then there's no better way to test/debug a location tracking application?I'm used to RIM's Simulator and the Sun WTK which both allow you to script a trip to the grocery store so you can track how your application reacts to changes in the location. I suppose this could be mocked and abstracted behind an ObjC protocol. Maybe in another release or two Apple will unlock this ability.

Cliff
+1  A: 

Better late than never :)

I just came across this iSimulate which allows you to send Fake location to the app. The solution is NOT free.

> Q: How does iSimulate work? 

> A: When added to your project, the iSimulate
> SDK library creates a listening server
> on your iPhone Simulator that waits
> for a connection from an iPhone/iPod
> running the iSimulate client. When
> such connection is established, the
> iSimulate client running on your
> iPhone/iPod captures all data from the
> accelerometer sensor, the touch
> events, the location and device ID and
> streams them to the server. The
> iSimulate SDK library then recreates
> all input events synthetically. This
> is entirely transparent to your
> application and does not interfere
> with your application's functionality.

Anyway, i am planning to get this. will update more soon!

Prakash
I just contacted the developers: "In the Options of iSimulate, accessible from the top-right button in the "Select Computer to Connect to" screen, you can select one of four other locations to use." So, not much help really.
sbwoodside
A: 

Where you want to set your location? you can use mapkit api to show u location's. see icodeblog.com for more detail on how to use mapkit. Also you can store your desired cordinates just create an object CLLocation2D *location; location.longitude=your desired longitude value; location.latitude=your desired latitude value;

Rahul Vyas
This was an old question from when I wasnew to the SDK. I now realize there is no support for automating CoreLocation in the Simulator, which is a shame.
Cliff