70

I received an error (Domain = LaunchServicesError, Code = 0) when trying to launch my app in the iOS Simulator with Xcode 6. I looked for solution in google, but I didn't find anything practical.

What does this error mean?

Jeremy Huddleston Sequoia
  • 21,715
  • 5
  • 69
  • 82
Liran Revivo
  • 1,133
  • 2
  • 13
  • 20

31 Answers31

119

This error indicates that there was a problem with installation. Unfortunately, Xcode does not actually print the contents of the error message that would give you more insight, but you can look at ~/Library/Logs/CoreSimulator/CoreSimulator.log to see the rest of the error details. There will also be more information about the problem in the simulated device's system log (~/Library/Logs/CoreSimulator/[Device UDID]/system.log); look for messages from installd around the time of the error).

Common causes for this include bundles missing an Info.plist, missing keys within your bundle's Info.plist, or values for some keys in the Info.plist not being allowed.

If your app's Info.plist does not contain a valid CFBundleVersion key/value pair, it is possible that your app may install correctly the first time but fail to update. Many users seem to work around this by doing a "Reset Contents & Settings" after each install, but it would be better to fix the root cause by setting an appropriate CFBundleVersion in the Info.plist. I believe iOS 8.2 now correctly returns an error on the first install in this case rather than just on updates, so hopefully this problem will be more obvious now.

Users with home directories on file systems that do not support hard links (eg: network home directories via AFP, SMB, or some NFS servers) may also run into problems related to hard linking. If this is the case, I suggest you create a path on your local HFS+ filesystem for simulator development (eg: /var/simulator/[user]) and create a symlink to that path from ~/Library/Developer/CoreSimulator. This particular issue was fixed in one of the iOS 8.2 betas.

In another case, the Build&Run would always succeed on the first try, but subsequent attempts would sometimes fail due to a changed Info.plist (eg: because someone's build system settings result in CFBundleVersion being different on each iteration). You can usually recover by either deleting the installed app (using a long-press from the home screen or xcrun simctl uninstall [Device UDID] [app identifier]) or erasing the device back to a default state. To erase the device, execute xcrun simctl erase [Device UDID] from terminal or choose Erase Contents & Settings from the iOS Simulator menu. This particular issue was fixed in one of the iOS 8.2 betas.

A newer instance of this issue is occurring for Xcode 6.2 users. If you have a WatchKit App Extension bundled in your app, it will fail to install to versions of the iOS Simulator runtime older than iOS 8.2. As a workaround, you will need to manually disable the app extension from installing when you want to test with iOS 8.1 and earlier runtimes.

If you need more specific help, please provide the entirety of the error message from CoreSimulator.log and any messages from installd and CoreSimulatorBridge that appear around the same time in ~/Library/Logs/CoreSimulator/[Device UDID]/system.log as that will reveal the underlying problem.

Jeremy Huddleston Sequoia
  • 21,715
  • 5
  • 69
  • 82
  • 2
    Very helpful. Thanks! – Pat Oct 17 '14 at 21:05
  • 2
    This error might be caused by many reasons. And this answer gave a general way to solve it. Thanks. – WeZZard Oct 24 '14 at 02:30
  • 2
    Go to "iOS Simulator" drop-down in simulator app (OS X) and select "Reset Content and Settings..."...done! – TNBtech Dec 02 '14 at 03:49
  • 1
    @TNBtech That will only possibly address some of the possible causes. If resetting the device is helping you, you may be experiencing this due to a bad CFBundleVersion in your app's Info.plist – Jeremy Huddleston Sequoia Dec 02 '14 at 03:52
  • Awesome, you saved my day. I went through the CoreSimulator.log and found that my app extension doesn't follow the bundle ID as of app. Hence unable to run on simulator. Thanks a lot for the detailed explanation. – Vasu N Mar 12 '15 at 05:39
  • "~/Library/Logs/CoreSimulator/CoreSimulator.log" is the life saver. – Di Wu Apr 10 '15 at 08:13
  • Great solution... CoreSimulator log is the best way to figure out what's going. – Nikolozi Aug 02 '15 at 04:12
  • The log file location helped a lot... Thanks! – Romain Aug 16 '15 at 14:58
  • Saver -> log file location! Thanks – msk Oct 03 '15 at 09:22
  • For me, Build&Run only works on the first try. All the others fails. My Simulator log says: `Nov 15 07:37:34 com.apple.dt.Xcode[51360] : Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ExecutableTwiddleFailed, ErrorDescription=Failed to chmod file:///Users/Gui/Library/Developer/CoreSimulator/Devices/B9FE6520-D542-4CDD-9571-A3D8874416B6/data/Library/Caches/com.apple.containermanagerd/Temp/Bundle/Application/752518C9-3A40-4545-90E1-DEE6F3FCC15E/AppName.app/AppName : No such file or directory}` – Gui Del Frate Nov 15 '15 at 09:51
  • What version of iOS? If you see that with current versions, file a radar. – Jeremy Huddleston Sequoia Nov 16 '15 at 01:16
  • Helped a lot. Saved my day! – Dmytro Hutsuliak Dec 12 '15 at 09:02
  • I am still stuck. Tried all suggestions given in this forum. log file gives: Apr 1 20:01:59 Toms-MacBook-Air SpringBoard[988]: [appinstallation] LaunchServices observer: Apps Failed be installed: ( " no.SolbuInnovasjon.eFlora ". What does that mean? "not found in database"? – Tom Tallak Solbu Apr 01 '16 at 18:04
  • same problem here, my project had a key in my info.plist that was missing a value. thanks for the explanation – nbpeth Apr 09 '16 at 14:01
  • This is probably the most helpful answer ever! Saved the day! Thank you! – manosim Jun 28 '16 at 10:33
  • Wow, had this issue for so long on a certain build scheme. The log tip solved it. Thank you!! – Canucklesandwich Jul 19 '16 at 15:47
  • Very helpful. Founded the error in CoreSimulator.log file and fixed it. I am working on iWatch application and corrected the value of WKCompanionAppBundleIdentifier, it worked. – PurnachandraObulasetty Aug 18 '16 at 11:31
  • Please help why the error is coming missing bundle identifier . I have bundle identifier in every info plist of my project and a cocoapod i have installed. 6E2FF83352D8/data/Library/Caches/com.apple.mobile.installd.staging/temp.RqxtmK/extracted/CocoaTest.app/Frameworks/Myframework.framework did not have a CFBundleIdentifier in its Info.plist – Abhishek Thapliyal Aug 19 '16 at 16:24
41

Does your project include a widget or extension? If so, the problem could be the bundle identifier of your widget/extension. It should be the same as the main target, appended with a period and an extra string. So for example:

Main target: com.mycompany.myapp

Widget should be: com.mycompany.myapp.widget

Rachid Finge Jr
  • 1,161
  • 10
  • 14
  • 1
    This did the trick for me, thanks! – Jason Sep 24 '14 at 17:13
  • This happened to me after "disabling" a work-in-progress iOS 8 extension by removing it from the Target Dependencies. It seems that that is not enough to make Xcode happy. – Rivera Oct 27 '14 at 09:06
  • 1
    Awesome!! Solved this!! – ajay Jan 03 '15 at 09:28
  • Thanks a lot..This is very helpful to me...Do you know how give full access of custom keyboard ..Like (swiftkey keyboard , go keyboard & etc ) – Divyesh Dobariya Jul 24 '15 at 04:54
  • Yes this is the solution also for me in XCode7. Thanks – Lorenzo Sep 12 '15 at 14:28
  • I have used 1)com.XXX and 2) com.XXX.Keyboard. It's not working for me getting same error! – kb920 Feb 16 '16 at 09:07
  • It was strange, that my framework was missing the bundleid, but it was working, and then "something happened" and it wasn't any more. Adding the bundle id in the framework again fixed it. – Nick Jul 18 '16 at 21:12
39

I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...

Chris Long
  • 499
  • 3
  • 2
25

Since everyone writes what they went through and how they fixed their exact problem, that might be unhelpful.

The problem is that there are different causes for the same error message and the right way of solving it is to open up ~/Library/Logs/CoreSimulator/CoreSimulator.log and look in there for the last message. This message gives you a good clue and sets you on the right path of solving your problem (sometimes it's bundle IDs, sometimes it's a missing or an extra attribute in the Info.plist, but you always get a good, descriptive clue).

This is how you narrow down the problem and eventually get to fix it.

Good luck and tough nerves with Xcode .)

Z.

Zoltán
  • 1,302
  • 14
  • 22
18

For me I just cleaned the project and it worked -> Product -> Clean

  • This error happened to me when switching back and forth between Xcode 6.1.1 and Xcode 6.2 beta 5. Cleaning fixed it. – Liron Yahdav Mar 04 '15 at 19:07
15

TLDR: Clear your Project Build Folder - and you will be free of this pain.

( plus I logged this as a bug with Apple as they need to find a way to fix this in Xcode )

None of these solutions worked for me - I banged my head against several walls.
I looked at the CoreSimulator log and I realised that it was trying to build a library that I had deleted. I couldn't find references to it anywhere.

Then I saw via another SO Question which unfortunately I can't find to reference, if you:

  1. Hold down your option key then Product-> Clean option becomes Clean Build Folder
  2. Press that and enjoy having your error vanish
UKDataGeek
  • 5,463
  • 8
  • 39
  • 58
  • 1
    This works for me, it has to be "Clean Build Folder" not normal clean ones. Note: option key is ALT key on windows keyboard. – Wappenull Jul 29 '16 at 04:19
12

"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.

Reset Content and Settings

Sauvik Dolui
  • 5,060
  • 3
  • 29
  • 38
9

In XCode 6

An error was encountered while running (Domain = LaunchServicesError, Code = 0)

I had this error after making some major code changes to accommodate the iPhone 6 Screens. in Xcode 6 (iOS8)

I followed the options above and found that the only way to really get this fixed was by doing the following:

  1. Deleted the derived data [go to Window >> Organizer >> (Find your App) Click on Delete next to the Derived Data]

  2. Product >> Clean

  3. Reset Contents and Settings in Simulator

  4. Changed the Bundle Version to 1.4.1 from 1.4 in pList

    Thank you for all the previous answers that got me to this stage. It worked a charm!

Community
  • 1
  • 1
Meg de Graaf
  • 91
  • 1
  • 1
5

In my case, the error was caused because i didn't set the build id.

Setting this, launches the emulator without problem.

jos
  • 1,030
  • 12
  • 21
3

One other thing to try, that worked for me, after resetting the simulator and doing a clean build did not help, is clearing out the derived data. To do this: go to Organizer click on project click on delete derived data button. I had this happen after working on an extension for a while and went back to the regular branch. Hope this helps.

possen
  • 6,778
  • 2
  • 34
  • 43
3

This is what caused the problem for me: the build number for the main app and the extension were different (I had incremented the main app build number to 1.0.1.03, but left the extension at 1.0.1.02).

Making them match fixed the problem for me.

gb_kf
  • 93
  • 1
  • 1
  • 6
3

Open the Console app and look there. In my case it told me exactly what to do. I saw:

ErrorDescription=WatchKit 2 app extension's NSExtension.NSExtensionAttributes.WKAppBundleIdentifier value does not match WatchKit app's bundle ID (found "com.myCompany.MyApp.MyApp.watchkitapp"; expected "com.myCompany.MyApp.watchkitapp").

So, I went to each plist and checked any items that related to a BundleID. Then Clean, relaunch, etc.

Jeff
  • 2,395
  • 20
  • 39
3

I have an app that is set up to use different bundle IDs based on the build configuration. When creating my Apple Watch extension, Xcode generated everything using my Release ID, so I had to go through and change it all manually for debugging. Here's all the places I had to change it:

  • WatchKit Extension's Build Settings -> Packaging -> Product Bundle Identifier
  • WatchKit Extension's Info.plist -> NSExtension -> NSExtensionAttributes -> WKAppBundleIdentifier (this needs to use the same prefix as your companion app)
  • WatchKit App's Info.plist -> WKCompanionAppBundleIdentifier

The last one took me a while since the WatchKit App's Info doesn't show up as a tab when viewing the target settings, I had to go direct to the Info.plist file itself.

SeanR
  • 7,053
  • 5
  • 24
  • 38
2

Try putting some number into [TARGETS]-[General]-[Identity]-[Version(or Build)], if they are empty.

It worked for me.

I hope it will help you.

4F0A
  • 21
  • 1
2

I also have this error. In my case the log ~/Library/Logs/CoreSimulator/CoreSimulator.log was something like that :

Could not hardlink copy /Users/myUser/Library/Developer/CoreSimulator/Devices/60E569E7-6750-428A-A401-841BB081xxxx/data/Containers/Bundle/Application/70F24DDC-7954-46BF-B799-F807FD98yyyy/myApp.app to /Users/myUser/Library/Developer/CoreSimulator/Devices/60E569E7-6750-428A-A401-841BB081xxxx/data/Library/Caches/com.apple.mobile.installd.staging/temp.kOrJ9G/extracted/Payload/myApp.app with manifest /Users/myUser/Library/Developer/CoreSimulator/Devices/60E569E7-6750-428A-A401-841BB081xxxx/data/Library/Caches/com.apple.mobile.installd.staging/temp.kOrJ9G/extracted/com.apple.deltainstallcommands.com.mycompagny.myapp

thanks to this answer In look at my app info.plist. the key CFBundleVersion was missing so I add it and now everything is working !

Community
  • 1
  • 1
Thomas Besnehard
  • 1,996
  • 3
  • 21
  • 46
2

None of the above worked for me, but this did:

I simply deleted IceCream.xcworkspace/xcuserdata/xcuserdatad and then reset the simulator and ran the app again. (Reseting the simulator alone, did not work for me.)

Andrew Paul Simmons
  • 3,315
  • 3
  • 24
  • 31
2

The great explanation by Jeremy at least set me in the right direction, but despite having all the bundle identifiers and versions set correctly, the error still persisted. I then checked the Apple documentation which shows that the WatchKit extension (in its Copy Bundle Resources phase) copies the WatchKit app. This WatchKit app was named exactly the same as my iOS app, causing Xcode to confuse the two and read out the wrong plist, thinking the bundle identifier was incorrect. Renaming the Product of the WatchKit app to something distinct finally solved it for me.

Jagat Dave
  • 1,633
  • 3
  • 22
  • 30
Toine Heuvelmans
  • 464
  • 3
  • 11
  • Greetings, even thought Apple might be a solid link, it would be better to include the important part of the link as a quote in your answer using the edit link button! – ForceMagic Nov 25 '15 at 14:50
  • Thanks ForceMagic, I'll pay attention to that in the future. I'm a bit new to posting on stackoverflow. – Toine Heuvelmans Nov 26 '15 at 15:22
  • No problem! What is cool with SO, is that it's auto-managed by the community and it's designed that every post is improvable :) That's why, you can always edit your own post and improve it! Simply click on the edit link button below it! ;) – ForceMagic Nov 26 '15 at 15:33
2

My case was about framework compilation. I have enabled the 'copy only when installing' option from Target- Build Phases- Embedded Frameworks-enter image description here

A.G
  • 13,048
  • 84
  • 61
2

"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.

hitesh landge
  • 362
  • 4
  • 14
  • 1
    Just starting out with React Native and this helped me when `react-native run-ios` was having unexpected results. "Reset Content and Settings" and then quit simulator and ctrl+w to close the react packager terminal and rerunning `react-native run-ios`. – Stephen Tetreault Dec 08 '16 at 02:57
  • I also had this problem with React Native and doing a this also solved it for me. Thanks :) – TheLukeMcCarthy May 09 '17 at 23:31
1

If you've changed your bundle ID, make sure you do a clean build before trying to build it again! See how here: How to Empty Caches and Clean All Targets Xcode 4

Community
  • 1
  • 1
BigCheesy
  • 1,098
  • 8
  • 14
1

So it's definitelly .plist problem. In my case it was empty NSExtensionMainStoryboard, removing this property fixed the problem

Maciek Czarnik
  • 5,474
  • 2
  • 33
  • 48
1

I had this error whilst trying to build Apple's Lister Xcode Project and run it on the simulator.

The essentials which fixed it for me were:

1) BundleID for the iOS App and the iOS Extension had to be different 2) I provide iCloud and App Groups for both targets 3) I used Xcode's "Fix Issue" to fix the issues

After that I could build and run the app without warnings or errors.

The clue from the log file was "... LegacyErrorString=DuplicateIdentifier, FunctionName=-[MIInstallableBundle performPreflightWithError:], SourceFileLine=450, NSLocalizedDescription=The parent bundle has the same identifier (com.ACMECompany.Lister) as sub-bundle at /Users/stephen/Library/Developer/CoreSimulator/Devices/5329928B-946B-40A4-B666-EFD11B96D11F/data/Library/Caches/com.apple.mobile.installd.staging/temp.HQ5d9X/extracted/Lister.app/PlugIns/Lister.appex"

Stephen Watson
  • 1,650
  • 16
  • 17
1

Had a wrong app version set in InfoPlist.strings localization file. Urgh!

An hour gone!

Alexandre G
  • 1,450
  • 16
  • 27
0

enter image description here

Delete your simulator and regenerate one.

It works for me.

keywind
  • 1,015
  • 14
  • 24
0

I removed the key in watch app's .plist file that shouldn't have been there. And the problem disappeared.

mikezs
  • 301
  • 1
  • 7
  • 16
0

This worked for me: In project settings -> General tab -> Identity section I changed the Version number from something like 2.0.2 (three digits) to 2.0 (two digits) then I deleted the app in the simulator and run the project again. No more error after that.

0

One other possible solution to add to all of the others that will no doubt stay above mine ;)

I deleted & later reinstated a Today Extension target retaining the source files, but after trying every solution under the sun, I realised it didn't have any sources or resources in its target! You might encounter this as well if your detailed launch services error can't find your compiled app extension file.

So, long story short, make sure your target has something included to compile or bundle in there. You can check your target memberships by selecting the relevant file(s) on your project navigator (on the left) and setting your checkmark(s) as appropriate in the file inspector (that's the first tab on the right).

Simon Rice
  • 1,067
  • 1
  • 13
  • 21
0

I had the following in my log...

<Error>: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ExecutableTwiddleFailed...

This was due to there being no source files added in the extension project.

combinatorial
  • 8,221
  • 4
  • 38
  • 57
0

This error was showing up on my system when there was no hard disk space available. I freed up some space on my system for it to work.

anjani kp
  • 55
  • 7
0

My Problem was that the wrapper extension for the target project was unset.

To fix I had to go to target project -> build settings -> Packaging -> Wrapper Extension.

Set this to "app" (No quotes)

This fixed the problem for me

smac89
  • 26,360
  • 11
  • 91
  • 124
0

I had this problem too, turns out one of my info.plist was assigned to the target specifically when its suppose to be assigned to none. There is actually an Xcode settings recommendation warning, which I tapped and accepted the changes. This resolved the issue.

Ace Green
  • 269
  • 4
  • 27