Skip to content

Month: August 2016

How to fix Xcode Crashes

Tips for when your Xcode/beta crashes when you try to run.

TLDR: Xcode was crashing after building successfully but before running. Deleting my User Prefs fixed my error, but I’ve listed the steps I tried, and some other best practice options below.

My problem was this: Xcode 8 beta 2 arrived, and I went merrily on my way playing with all the great stuff we learned about at WWDC.

However, everytime I tried to build and run in the new Xcode beta 2 (and later in beta 3) I would get a successful build and then the whole program would crash without opening the simulator or deploying to a device.

I talked to a lot of people in my knowledge network, and did all sorts of searching on the error I was getting:

“Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 8S162m
_ASSERTION FAILURE_ in /Library/Caches/”

This was strange, because the app I was working on was not using SpriteKit at all.  It was from a tutorial from Paul Hudson from his new Practical iOS 10 book. (which is great so far, fyi)

To test that it wasn’t something I’d done in the project, I made a new blank one, cleverly named ‘dontcrash’, and tried to build and run it. Xcode crashed again.

I actually ended up with several blank apps: dontcrash2, dontcrash3 dontcrashXcodebeta3 and finally- CrashyApp, before I hit on the solution. 

Basic Options for Xcode Crashes

  1. Clean the project.
  2. Target a different simulator you haven’t tried with the project yet.
  3. Delete Derived Data directory
  4. Delete app, re-install.
  5. Delete User Preferences
    1. As mentioned here:
    2. Note: Deleting the app and reinstalling does not remove the user preferences.
    3. This fixed my problem.Not sure how my prefs got confused in the first place.

Advanced options (I didn’t get this far)

  • Monitor memory usage in the Debug navigator
  • Inspect a few malloc generations in Instruments