Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 570
NFerocious Avatar asked Aug 05 '14 03:08

NFerocious


3 Answers

I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...

like image 177
k20 Avatar answered Nov 07 '22 00:11

k20


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

like image 60
Sam Soffes Avatar answered Nov 06 '22 23:11

Sam Soffes


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.

like image 14
hufeng03 Avatar answered Nov 07 '22 00:11

hufeng03