Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0) Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0) swift swift

Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0)


I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...


This happens if your extension's bundle ID isn't prefixed with your app's bundle ID. For example if you app is com.mycompany.appname, your extension should be something like com.mycompany.appname.today.

Something else to note, if you're using Swift and are setting a principal class with NSExtensionPrincipalClass, you'll want to make sure your extension target sets "Defines Module" to "Yes" and make the value of NSExtensionPrincipalClass equal to "YourModuleName.YourClassName".


It seems that there are multiple reasons for "domain = LaunchServicesError code = 0" error. I also encountered it, while I try to reinstall app on iOS8 simulator. I cannot reinstall but have to delete the old app first.

The problem was solved by:

  1. In Xcode, fill empty Version or Build field with appropriate value in your Target->General->Identity

  2. In Simulator, reset Content and settings...

After that, everything works fine.