Show Menu

Looking for an iOS Developer?

Submit your 30 day Job Listing for FREE

In this quick tip tutorial I am going to show you how to set the location of the iOS Simulator.

I get a few emails a month asking for this so I decided to write a quick tutorial.

Create Location Resource

In Xcode, go to File -> New -> File. Then from the side menu of the new dialogue that pops up, select Resource. Now you have some extra options, form these select GPX File

create gpx resource

Click Next. You will then be asked to type in a name. I have called mine 10DowningStreet. Then save it.

Now, In your project navigation pane in Xcode, make sure you have your gpx file selected.

Edit everything in there so that it matches:

<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
 <wpt lat="51.5034070" lon="-0.1275920">
 <name>10 Downing Street</name>

Where ‘lat’ is the latitude and ‘lon’ is the longitude.

Set iPhone Simulator Location

This part is easy. Now, run whatever app you’re running. Go back to Xcode while the app is running and select the location icon near the console. You should now see 10DowningStreet in the dropdown list:

simulator locations

having issues?

We have a Questions and Answer section where you can ask your iOS Development questions to thousands of iOS Developers.

Ask Question

FREE Download!

Get your FREE Swift 2 Cheat Sheet and quick reference guide PDF download when you sign up to SwiftMonthly

Sharing is caring

If you enjoyed this tutorial, please help us and others by sharing using one of the social media buttons below.

iOS-Blog Admin Team

Written by:

We're here to help.