Xcode 4.2 with iOS 5 to test location services in simulator

Question: I’m an iPhone programmer and have a problem. I should test and debug my iPhone/iPad application with location services for different GPS positions and routes. Do you have a static library or module that produces GPS coordinates in the preset range? Answer: You do not need GPS location simulator any longer. Since Xcode 4 and iOS 5 you can select from preset locations or add routes to your project while you’re running your simulated app. Visit Apple’s web site for details from here.

In Xcode 4.2, to preset a default location for your project, choose Product -> Edit Scheme – or from the scheme selector in the toolbar find Your project name > Edit Scheme… – and select the Run action. Click the Options tab. Allow Location Simulation and choose one city from the the drop-down list.

While testing your app in the iOS Simulator, you can select Product -> Debug -> Simulate Location from the menu bar and choose any point from the preset locations:

iPhone 5 (iOS 5) Simulator settings in Xcode 4
'iPhone 5.0' (aka iOS 5) location simulating in Xcode 4.2
Your options:

1. Preset a single Location in your Scheme.

2. Choose a Location from the Program -> Debug -> Simulate Location menu (see above), or

3. Choose a Location from the Debug Bar (see below). if you are not running iOS 5.0 or later, these options can’t be used. Switch to iPhone 5.0 Simulator to allow selection:

Choose a Location from the Debug Bar of Xcode 4
Choose a Location from the Debug Bar

4. Edit a GPX file and add it to your project to establish single or multiple custom waypoints. GPX (GPS eXchange Format) is an xml data format for exchanging GPS data between programs. You can add one or more GPX file to your project. These files look like:

For: Cupertino.GPX:
<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
    <wpt lat="37.331705" lon="-122.030237">
        <name>Cupertino, USA</name>
    </wpt>
</gpx>

For: Munich.GPX:
<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
    <wpt lat="48.122101" lon="10.695933">
        <name>Munich, Germany</name>
    </wpt>
</gpx>

You can edit and add it to your project like any other file(s) or resources:

Adding GPX file to a project
Add your GPX file to your project