I like the smell of Swift in the morning…

Permanently simulate location in the iOS Simulator

Posted: | Author: | Filed under: Xcode | Tags: , | No Comments »

In an older blog post I described how to simulate a custom location in the Simulator by using a GPX file. During my current project I have to use simulated locations a lot. But every time I ran my app in the simulator Xcode deactivated the location simulation. So I had to manually select it again with every start of the app. Really annoying.

As it turns out there is way to permanently enable location simulation in the Simulator. It’s just a bit hidden. To always enable location simulation open Edit Scheme for the scheme you are running and then under Run > Options select one of the available locations as Default Location because otherwise the default is None and no location is simulated.

Bildschirmfoto 2017-01-14 um 22.03.33

Voilá, once you select a default location for your scheme the Simulator keeps simulating the location everytime you start it.