Our DNA is written in Swift

Fixing the Simulators

I’ve been having some issues lately with the iOS simulators on my MacBook. I kept getting messages of the sorts that some “/tmp” could not be deleted because of lack of permissions.

The only way to fix that was to create a new simulator device. But I was made aware of a tool that helped me fix the dilemma.

Creating devices with XcodeXcode lets you configure a variety of simulated devices on the Devices window. Click the Plus button, choose a descriptive name, select an iOS version and (optionally) a 42mm or 38mm simulated Watch.

So my workaround for a while was to create a new device there so that I could continue to debug apps. But it was quite tedious having to fiddle with the xcodebuild destination parameter to select my device.

One working, two notTrying to fix the busted simulators I deleted them from Devices as well as tried to clean them from ~/Library/Developer/CoreSimulator/Devices but I didn’t end up in a satisfactory state.

I had ended up with two defunct simulators and only the “New Phone” simulator was actually functional. So I resigned to the situation and sent a sigh to the heavens with a wish attached that somebody should help me fix this.


It so happened that I met Tomaž Kragelj – of appledoc fame – at Pragma Conference and while we were casually talking he mentioned this great tool which lets you completely reset your simulators to a pristine state.

The tool is Snapshot by Felix Krause and is part of Fastlane Tools. It is usually used for automating the taking of screenshots of your apps. It also has a facility for completely removing and recreating the standard simulators.

To install it you do:

sudo gem install snapshot

The installation instructions also recommend updating your Xcode command line tools:

xcode-select --install

Then I ran the following:

snapshot reset_simulators

The lengthy result is shown in the following screenshot:

Snapshot sim reset

On this output you can see that two simulators could not be removed “because you don’t have permission to access it”. I tried the snapshot command with sudo but there was no difference.

So I searched for the mentioned device UDIDs and found them below ~/Library/Developer/CoreSimulator/Devices. A plain rm -rf did not work, again some messages about permissions, but sudo rm -rf finally managed to remove the defunct simulator device.

Sims ResetI ran snapshot again for good measure and finally ended up in the state that I was longing for. At fist glance I thought that the tool has made a mistake and duplicated the iPhone 6 simulators. But then I realized that the extra two were actually the iPhone 6s and iPhone 6s Plus.


Snapshot is the first of the fastlane tools I tried and I loved it. There was the minor issue of messed up permissions where the tool failed, but that was easy to remedy by hand.

You also can see that I didn’t get a recreated tvOS Simulator, but that is probably because I was running this with Xcode 7.0 selected.

But all in all I am very happy that I have regained a set of functioning iOS simulators. Thanks Felix Krause!

Categories: Tools

1 Comment »

  1. Bummer. On 10.11 I get:

    Building native extensions. This could take a while…
    ERROR: Error installing snapshot:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
    creating Makefile

    make “DESTDIR=”
    make: *** No rule to make target `”/Applications/Xcode’, needed by `websocket_mask.o’. Stop.