Using Location on an iOS Simulator

When testing an app that uses location services, it’s helpful to know that the simulator can simulate a real phone that changes its location.

Accessing Location:

Here are the choices:

  1. None: Location is not turned on
  2. Custom Location: a configurable static location with given Latitude and Longitude
  3. City Run: Simulates the user taking a run in Cupertino, California.
  4. City Bicycle Ride: Simulates the user taking a bicycle ride in Cupertino, California
  5. Freeway Drive: Simulates the user driving from Cupertino to San Francisco.
  6. Apple: Sets a static location to the Apple’s Infinite Loop campus in Cupertino

Using the Simulator Location

Static Locations

Here your two options are to use Apple’s location and/or set a latitude and longitude using Custom Location:

Note the use of the ‘minus’ sign for longitude. Most google searches for latitude and longitude don’t include it:

The static location can be changed while the app is running or not running.

Continuous Route

With some practice and experimenting, using the simulated location can be a useful tool. Hope this is helpful to you. Happy Coding!

Full Stack React Native & iOS Developer