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

I am unable to run my app in simulator after having trouble with the provisioning profile. I'm doing swift coding in Xcode 6 - beta 4. This was fine before the trouble in the certificate's profile.

I have tried cleaning the build. Checked the command line to xCode6-beta4 for running. Checked the build deployment, set to 7.0 so swift won't complain for compatibility Fixed the error in provisioning.


Solution 1:

I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...

Solution 2:

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".

Solution 3:

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.