Xcode: Could not inspect the application package - ios

I am running Xcode 6 and iOS 8 GM. Every other time I run my app I get this message from Xcode:
"Could not inspect the application package"
So I can run and build, I will get the message. I run and build again, everything runs as expected (this is to my device). Then it will rinse and repeat, every other time giving me this error.
I have looked at all the other solutions that have been suggested but cannot stop this error. I have cleaned my project, cleaned the build folder, deleted derived data etc with no luck.
How can I see what is causing this in the first place?
Interestingly, this only happens when running on my device. Not on the simulator. Also, it only happens on my device, when building for debug. If I change the scheme to release, I can build and run endlessly without with error. Ideas?

This error seems to happen when you have third party code which isn't signed by you in your bundle. Check this thread, it helped me once.
Also when performing build clean opt for cmd + option + shift + k.

This can happen with Xcode 6 and iOS 8 if a product name contains non-latin characters.
In this case changing product name to the one with only latin characters for debug builds fixes this problem.

Try to remove some libraries from your Xcode => Click on Target => General tab => Embedded Libraries (Keep only required libraries or Framework)
Here, remove (Use - sign on bottom to delete).
If you require the framework or libraries that you deleted, add this using Xcode => Click on Target => General tab => Linked framework and Libraries (Use - sign on bottom to add this).
This will work.

In my case, I needed to check the option that says "Copy only when installing" under "Build Phases/Embed Frameworks" in one of the frameworks I was embedding.

If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean.

I got this when a custom built .framework was missing its Info.plist.

I deleted my Info.plist and I dragged a new info.plist into my project. Xcode did not show me any warning but my app would not launch until i changed the name to Info.plist.

I've seen this error before when there is something in the entitlements file but is not enabled for the app id in the provisioning centre.
Specifically I had HealthKit enabled in the entitlements file but not configured for the application identifier.

I had a potentially similar problem, hardware only, when I had an app which was given entitlement to run in the background and had run previously on the phone. For such apps, I found the Xcode deployment to phone broken and had to change the bundle identifier to unjam the deployment.

I think there are third party files in your code, which might include compiled code which is not signed by you. If so, you can use iReSign to resign them using your own certificate. You can also use the command line:
codesign -f -s "iPhone Developer: Name (XXXXXXXXXX)" nameOfAppToSign.app
Replace the example identity with your own (you can man codesign to read more about this command).

I had the same issue, And was unable to install the ipa. It always ended with an error "Could not inspect the application package." and some warnings in device console
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: Please include the kCFBundleIdentifierKey in the options dictionary when installing an app.
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: installing app with unknown bundleID
.
.
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 -[MIBundle _validateWithError:]: 28: Failed to load Info.plist from bundle at path
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 + [MIInstallable installablesAtURL:packageFormat:userOptions:error:]: Failed to create bundle for …
After spending hours, I got it fixed by adding the "Application requires iPhone environment" in info.plist
<key>LSRequiresIPhoneOS</key>
<true/>

Found a solution by adding the Framework to General -> Linked Frameworks And Libraries and setting the status to optional. (Leave the embedded binaries blank)

deleting Pods and then calling pod install worked for me

Happened to me today. Yesterday everything was working fine and suddenly today I can't deploy because of this error:
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
on Xcode 13.4.1 and iOS 15.4. Nothing changed from yesterday. Tried to rebuild the project (not helped), relaunch Xcode (not helped), restart the phone (not helped) and rebooted my MacBook (not helped)...
Then I remembered that I merged the .project with another branch and inspecting the changes noticed that GENERATE_INFOPLIST_FILE = YES was removed from our custom .framework settings, so it was missing the Info.plist. Reenabling the flag the app deployed properly.
TLDR: Our custom built .framework was missing its Info.plist.

Mine turned out to be something to do with Apple's certificates and such. I was working between two different computers and I think something went amiss. So I had to revoke my developer certificate at the Apple iOS dev site, and request a new one with a private key etc. Once the new certificate was installed, the message went

For my case, it was file missing in a newly added *.framework. One *.plist file and "_CodeSignature" folder were missing in that *.framework. Replacing corrupted *.framework file fixed my issue.

http://www.developersalley.com/blog/post/2015/11/13/How-To-Fix-App-installation-failed-Could-not-inspect-application-package-Error-When-Installing-App-In-XCode.aspx
This link saved my life, I use the XUPorter plugin, the added folder has a plist file, which is my SDK provided to me

Change the Display name in Targets > General > Identity
Build your app and switch back to your old name.
It worked for me

In my case, the reason for this error was a corrupted Info.plist file in one of the frameworks. This happened because I used bash scripts to modify a copy of the project. When I started checking the files, I noticed that some Info.plist files are not viewed in Quick look. After packaging in the framework, Info.plist is converted to binary format, but when viewed through Quick look it is displayed as text. Thus it became clear to me what happened and after replacing the corrupted files everything worked like a charm

In case someone here is consuming bazel based xcframework in your xcode project, this might solve your issue: https://stackoverflow.com/a/74027282/6709940

I had the same issue, and the problem was that I had an alias in the xCode project. I removed it and it works.

You can try following steps:
Window->Projects and look for your project and delete 'Derived Data' for all your projects with the same name

Related

Xcode: Could not locate installed application. Install claimed to have succeeded, but application could not be found on device

I manually deleted my app from the iPhone and now I get this error message when trying to run it again from Xcode.
I cleaned the build folder, restarted the device, Xcode and the Mac, nothing helps.
I also tried everything that's mentioned here: Install claimed to have succeeded, but application could not be found on device
How do I force a re-installation?
As always, when the question is posted on SO, one finds a solution ;)
I edited the Scheme, setting the build configuration from debug to release and that installed the app again. Changed it back to debug and now it's running again as expected.
I ran into the same issue while testing a app on iOS 13 via XCode 11.0. Building via the legacy system solved it (File > Workspace Settings... > Build System > Legacy Build System).
Hope it helps
I had a similar issue after one of Carthage/XCode updates. It means iOS was not able to install app on the phone. XCode apparently is not able to provide this information directly. The first thing to do is open your phone console - go to Window/Devices and Simulators then select your device and click Open Console. In the console you can search for your app name what should provide you more detailed fail info. In my case it was sth like this:
Applications did fail to install: (
"<LSApplicationProxy: 0x118913b60> com.mydomain.myapp (null) <com.mydomain.myapp <INVALID >:0>"
) (appInfos: (null))
There was another console log few rows before flagging the problem:
0x16f4df000 -[MIExecutableBundle codeSigningInfoByValidatingResources:performingOnlineAuthorization:ignoringCachedSigningInfo:checkingTrustCacheIfApplicable:error:]: 789: Code signing identifier (org.alamofire.Alamofire.iphonesimulator) does not match bundle identifier (org.alamofire.Alamofire.iphoneos) for /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.E83T1l/extracted/myapp.app/Frameworks/Alamofire.framework
There was an issue with one of the frameworks Alamofire I'm using in the project. I changed bundle identifier of the project and build framework again what solved the problem.
Hope it helps!
In my case, the problem was an embedded framework that was not being signed. In the General tab of the project settings, setting the embed setting to 'Embed & Sign' did the trick.
In my case it was a problem with new Development certificate. It's created automatically after Xcode updated to 11 and may not be included in current provisioning profile.
I was facing similar issue in Xcode 11.1. I have fix this issue. Not sure about this solution that it will to work for all or not.
My device iOS version was older then the iOS Xcode target build version.
Steps:
I have put Xcode target Device to iPhone device OS version.
Delete derived data
Start xcode and open project
Clean the project and gererate build and install in device
Note: Please check your developer account, certificate validation and already registered device warning.
Hope this solution will help some peoples. Happy coding.
After trying everything here, for me the solution was to change my distribution profile to use the new Apple distribution certificate that covers all apple platforms. This should be compliant with xcode 11 (if you're not experiencing one of the other million problems since the "upgrade").
The cert change is mentioned here:
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes
Cert creation instructions here:
https://help.apple.com/developer-account/#/devbfa00fef7
Once done, make sure the correct profile is selected in Signing & Capabilities, and 'Apple Distribution' is selected under Build Setting -> Signing for the appropriate build configurations
A solution that solved this issue for me was to check the signing team for my tests target. Selecting the same development team then meant that my app was able to be built and run on device.
Build system: New Build System
Xcode: Version 11.1
Uninstall all the other apps that are under the same "Organization" or "Bundle Identifier" with your current app and try again.
It works for me. Hope it does for you too.
On your iPhone go to Settings/General/Profiles & Devices/Apple Development: "YOUR APPLE ID" and delete all apps from there. It fixed the problem for me.
It happened to me when trying to launch a watchOS app on a real device.
The only solution that worked was:
Delete iOS app from device
Delete watchOS app from device
Close and reopen Xcode
Clean build folder
I did a Product -> Clean then Build, and it was able to run.
Go to settings on your phone and wipe out all certificates and apps and then install your app again. That helped me
Problem occured on XCode 11
TL;DR:
Try changing Embed option in General=>Section Frameworks, Libraries.. to Do Not Embed (although it sounds strange)
In my General=>Section Frameworks, Libraries.. list are Security.framework and the CocoaPods Pods_projectname.framework amongst others. Default setting of these two was Do Not Embed. Sounded strange to me, so I changed it without need alternating to Embed & Sign or Embed Without Signing. With both options the error occured!
On your iPhone go to Settings/General/Profiles & Devices/Apple Deelopment: "YOUR APPLE ID" and delete all apps from there. It fixed the problem for me.
This was the solution that worked for me.
Please double check the bundle ID of the installed application to see if it is re-applied, this will also cause this problem .I uninstall the app and solve the problem.
In my case i have PROD certificate and trying to install the app in the device, later i changed to development certificate it got installed.
As Marcin's answer suggested, I visited the phone console and in my case, it is this error message:
-[MIFreeProfileValidatedAppTracker _onQueue_addReferenceForApplicationIdentifier:bundle:error:]: 182: This device has reached the maximum number of installed apps using a free developer profile: {(
So if you are signing your app with a Personal Team certificate, make sure that you don't have more than 3 apps.
Read more here: Why can I not install more than three apps?
As for me,
I added a custom key-value to Info.plist of main watchOS application file. That was wrong.
After removing it, all works correctly.
It seems this is not allowed but where is no other information about it.
If you have other under-development apps installed, try uninstalling those you are not using, and run Xcode to install your app again. It works for me.

Unable to install app in simulator Xcode 9 beta

I downloaded Xcode 9 beta recently, and when I tried to run my app in the simulator it is not getting installed. I am getting this error in my Xcode every time I try to run the app.
This app was unable to be installed.
The application used to work in Xcode 8.3.3
Unfortunately, the error message doesn’t explain why the install failed. You can take a look at ~/Library/Logs/CoreSimulator/CoreSimulator.log to see if the rest of the error message is there with more info. If not, you should check out the sim device’s system log:
sudo xcode-select -s /Applications/Xcode-beta.app # if you haven’t already
xcrun simctl spawn booted log show
You can use --predicate to filter that down a bit.
Late answer but might be that can be useful for others. I just get a project with existing watch-kit and custom keyboard code. After change the identifier i got the same error and i spend 1 day to find out why that happens.
I checked everything of bundle id and all version. then i do global search in xcode with old identifier and i found that following.
Here in both .plist file have old WKCompanionAppBundleIdentifier so after i update it with new manually application run again.
IMPORTANT NOTE:
IF YOU ARE JUST CHANGE IDENTIFIER FROM GENERAL TAB THAT DOES NOT MEAN IT UPDATE AT ALL. KINDLY CHECK WITH ALL POSSIBLE PLACES BY SEARCH AND REPLACE IT WITH NEW IDENTIFIER.
XCODE VERSIO: Version 9.0 (9A235)
I ran into this same issue and a quick click on Product > Clean did the trick for me!
If you are using CocoaPods in your project please have a look at this answer: https://stackoverflow.com/a/44533287/221194
Changing the status of the pods subdirectory helped me with my project.
I had a similar issue when installing my App on the IOS simulator (with Xcode 9).
I found the issue (at least for my case), it was due to an unauthorized key (Privacy - Location When In Use Usage Description) in the info.plist of the Watch App.
I have moved this key to the info.plist of the WatchKit Extension and now the App installs again.
I hope it will help others people having the same issue.
change deployment target as per requirement.
select project > GENERAL > DEPLOYMENT TARGET
also check ios version of your device
I had the same issue. Log shows it's an error caused by Google Signin:
FunctionName=-[MobileInstallationHelperService stageItemAtURL:completion:], SourceFileLine=392, NSUnderlyingError=0x7f891e9a1270 {Error Domain=MIInstallerErrorDomain Code=4 "Failed to remove ACL" UserInfo={NSLocalizedDescription=Failed to remove ACL, FunctionName=-[MIFileManager _removeACLAtPath:isDir:error:]
However it works on iOS 9 & 10 simulator.
I got same error and I was using Cocoapods in my project and for me help just update pods.
I ran into this issue in Xcode 9.0 beta 5 after renaming a project that contained an iOS and watchOS app. To fix, I recreated the iOS target.
This issue could be triggered by multiple things however if you take a look at the logs at ~/Library/Logs/CoreSimulator/CoreSimulator.log and it states an error that reads :
NSUnderlyingError=0x7fb51c271ee0 Could not hardlink copy /originPath
to /destinationPath
it's possible that your Build number in your Project Target's settings is set to empty.
Go to Project Target > Identity > Build and set a Build number. You'll have to uninstall the the app in the simulator and re-install it before installing updated versions.
Please check the bundle identifier to solve the issue.
I had the same issue on XCode 9.3.1 when I wanted to add google map framework to my project manually.
To fix the problem I remove the google frameworks from Embedded binaries...

Simulator fails with (LaunchServicesError error 0.) [duplicate]

This question already has answers here:
Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0)
(19 answers)
Closed 5 years ago.
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?
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.
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
I fixed it by resetting the simulator:
iOS Simulator > Reset Contents and Settings...
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.
For me I just cleaned the project and it worked -> Product -> Clean
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:
Hold down your option key then Product-> Clean option becomes Clean
Build Folder
Press that and enjoy having your error vanish
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
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:
Deleted the derived data [go to Window >> Organizer >> (Find your App) Click on Delete next to the Derived Data]
Product >> Clean
Reset Contents and Settings in Simulator
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!
In my case, the error was caused because i didn't set the build id.
Setting this, launches the emulator without problem.
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.
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.
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.
My case was about framework compilation. I have enabled the 'copy only when installing' option from Target- Build Phases- Embedded Frameworks-
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.
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.
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 !
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.)
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
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.
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
So it's definitelly .plist problem. In my case it was empty NSExtensionMainStoryboard, removing this property fixed the problem
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"
Had a wrong app version set in InfoPlist.strings localization file. Urgh!
An hour gone!
Delete your simulator and regenerate one.
It works for me.
I removed the key in watch app's .plist file that shouldn't have been there. And the problem disappeared.
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.
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).
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.
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.
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

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

This question already has answers here:
Unable to run app in Simulator : An error was encountered while running (Domain = LaunchServicesError, Code = 0)
(19 answers)
Closed 5 years ago.
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?
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.
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
I fixed it by resetting the simulator:
iOS Simulator > Reset Contents and Settings...
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.
For me I just cleaned the project and it worked -> Product -> Clean
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:
Hold down your option key then Product-> Clean option becomes Clean
Build Folder
Press that and enjoy having your error vanish
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
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:
Deleted the derived data [go to Window >> Organizer >> (Find your App) Click on Delete next to the Derived Data]
Product >> Clean
Reset Contents and Settings in Simulator
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!
In my case, the error was caused because i didn't set the build id.
Setting this, launches the emulator without problem.
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.
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.
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.
My case was about framework compilation. I have enabled the 'copy only when installing' option from Target- Build Phases- Embedded Frameworks-
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.
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.
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 !
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.)
"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.
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.
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
So it's definitelly .plist problem. In my case it was empty NSExtensionMainStoryboard, removing this property fixed the problem
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"
Had a wrong app version set in InfoPlist.strings localization file. Urgh!
An hour gone!
Delete your simulator and regenerate one.
It works for me.
I removed the key in watch app's .plist file that shouldn't have been there. And the problem disappeared.
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.
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).
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.
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.
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

Xcode suddenly stopped running project on hardware: "Could not launch xxx.app: .. No such file.." [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Xcode has stopped being able to run my app, it started directly after I deleted it from the device and attempted to re-install by rerunning it in Xcode (something I've done hundreds of times before).
It says
"Could not launch XXX.app"
"No such file or directory (/Users/Mylaptop/Library/Developer/Xcode/DerivedData/MyApp-ekxcbebfpzkahtfkujyqkcwprzia/Build/Products/Debug-iphoneos/MyApps.app/MyApp)."
I've rebooted the phone, relaunched Xcode, cleaned everything, rebuilt everything. This error message won't go away.
This is with Xcode 4.5 which I've been using since it became available, if I revert to 4.3.2 then Xcode says "Finished running app" but it doesn't actually do anything - the app is neither installed nor run.
I'm completely stuck - unable to run anything on the device anymore.
Any suggestions?
That is really annoying. This error happens in a number of different situations. Sometimes restarting the Xcode, fixes the problem. If not, follow these steps:
Disconnect your device.
Delete the app from your device.
Quit Xcode (Do not just simply close the window, quit it)
Delete derived data folder (~/Library/Developer/Xcode/DerivedData/-gbrvhlvwmpiobxdujegtghggrffp - or something like that)
Now start Xcode once again, connect device and run the project. It should work fine.
from DhilipSiva blog
Try deleting "Required device capabilities" in the -Info.plist file.
You can't require armv7 on a 3G, and you can't require armv6 on any newer device, so just delete this attribute entirely.
I found the answer. The iOS deployment target's version was not the same as my device's OS version.
First tried some of the above with info.plists and deleting derived data, clean, etc.
My solution: quit XCode, reopen project. Go to derived data in Finder. Deleted data for all projects (was all trashable, but I would try deleting your troubled projectdata first). And then it worked again. Deleting derived data from XCode didn't work.
The following resolved my problem... my app worked for me in debug/release, then I built a few ad-hoc archives and debug/release builds stopped working.
Symptoms:
invalid entitlements errors when launching from Xcode to device (play with entitlements...)
immediate abort with no error (finished running ) when running simulator
could not launch ... directory blabla.../build/product/debug-iphoneos/... not found when launching from Xcode to device.
Eventually after trying to benefit from everyone else's pain I found in Targets [AppName]:
Build Settings
Build Locations
Build Products Path build
should be
Build Products Path build/Products
No idea how this got set incorrectly.
This must be hard-coded somewhere in Xcode/Springboard because 'Products' appears in both Xcode and in the Device console.
This is Xcode 4.5.1.
I solved this problem by
renaming a directory above my XCode project
Changing the name of the project in XCode fixed it for me.
In XCode, under the Project Navigator, click the project name, and it should let you rename it just like a file in Finder. Deleting derived data did not help.
I built my XCode Project with CMake and somehow it (or my stupid self) deleted or emptied the property "Executable file" in the info.plist. I set it back to ${EXECUTABLE_NAME} and it worked again.
Took me really alot of time working through all the suggestions and fixes until I finally found that problem.
Hope this will help some one struggling with the same problem
Edit:
It was in some way CMake messing up my plist file. I created my own Info.plist and used it the following way:
SET_TARGET_PROPERTIES( MyApp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/MyApp.plist )
Inside my plist I had this entry:
<key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string>
Unfortunately CMake still seems to parse that file and replaced ${EXECUTABLE_NAME} with an empty string since its the CMake variable syntax. My quick work around is the following:
SET( EXECUTABLE_NAME "\${EXECUTABLE_NAME}" )
Now it works like a charm.
I am probably alone with exactly this problem, but who knows.
I had the same problem, but in my case I had a wrong requirement in my info.plist (require gyroscope for an iPhone 3Gs)
I tried to run my project on a different system other than that on which it was developed. I was getting “Could not launch xxx.app: .. No such file..”.
Removed the app from the device and then deleted the derived data from organizer in xcode for the app.
Organizer-->Projects-->Derived DAta-->Delete
My problem was resolved.
You need to set the deployment target LOWER than your device's version
For me, the solution was just to use the correct (non-distribution) provisioning profile.
I was defaulting to always using my ad hoc provisioning profile, but then I changed to using my developer profile (team profile) and that solved things. I went ahead and cleaned out the Derived Data directory to be safe but I don't know for certain if it is required.
XCode used to have a warning that told you to use the correct provisioning profile but that error message seems to have gone away in XCode 4.5.
I've had this problem by a very strange solution.
My problem was slightly different as I have 2 Developer certificates in Keychain. We have two developer accounts (lets say AD and BD).
1) I did change Bundle identifier from com.BD.game to com.AD.game
2) Device on which I had problems was only signed in AD provisioning profiles.
3) I was unable to debug the game on iPad - although the device had valid provisioning profiles, I had valid certificates, I restarted Mac, device, reinstalled Xcode ... nothing helped.
Do what i did today was examining the project.pbxproj file for any strange entries.
What I found was that Xcode was using proper provisioning profile, but signed the ipa/app with wrong certificate.
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: **BD** (XX******)";
After I manualy corrected the name and id; everything works like charm.
I got the same error. In my case I was set deployment target as 6.1 and trying to run an iOS 5.1 iPad. When I changed my deployment target to 4.3, issue solved.
Still having the problem . Try this
Disconnect your device.
Delete the app from your device.
Quit xcode.
Now start Xcode, connect device and run the project. It should work fine.
For me (using IOS 7 and Xcode 5), the error went away right after I did "Add to Member Center" with my device in the Organizer.
I would like to mention that the easiest way to open the DerivedData folder in Finder is the following:
Open the Organizer.
Click on "Projects".
Select your problematic project.
Next to the path of the DerivedData, click on the little right-arrow button.
Deleting the contents of the DerivedData folder worked for me. Instead of using the "Delete..." button, you should have more success deleting the files manually through Finder.
Go to: your project Target - > Info and from CustoM iOS Target Properties remove the Required Device Capabilities.
In my case that were armv7 and armv7s.
After that the app was built successfully on my iPhone 4.
This is how it looks after i removed both of requirements
For me, I forgot that I had "telephony" in the "Required device capabilities" in the info.plist. Removed that, and it finally worked on my iPad.
For me restarting of Xcode, cleaning DerivedData and restaring device wasn't enough in most cases, until I had figured out that iTunes was also running, and after quitting iTunes everything worked fine!
So my steps now are simple:
1. Quit Xcode.
2. If iTunes is running, quit iTunes.
3. Reopen project.
No need to remove app from the device, clean project or restart/disconnect device.
I think that's because Xcode and iTunes use some common libraries (as you know, Xcode Installer always asks to quit iTunes on installing iOS SDK).
I had this problem and tried a number of the suggestions which didn't work for me - then I found the one about removing the "Required device capabilities" in the -Info.plist file (which for me included location-services & gps)
That worked!
I then re-added them and it still worked.. go figure.
This was xCode 4.6.1 & my app is developer with Phonegap/Cordova
I tried all the above and yet it still wouldn't run. I fixed the problem by changing the derived build location. File>Project settings>"derived data location" change to project-relative. Or you could just make sure the default path has permission to read/write.
My issue seemed to be picking picking Portrait (top home button) as Item 0 in Supported Interface orientations in my plist. Removing that or moving it down seemed to fix my problem. Go figure.
I had this problem too for a Universal app with Xcode 4.5 on my iPhone ONLY, where I had two debug devices:
iPhone 4 iOS 5.1.1
iPad 1 iOS 5.1.1
The Info.plist had an empty entry under "Required device capabilities"
I know that I did not enter this empty 'Item 0'. The app loads on the iPhone
since I removed the empty item. I did not encounter
this problem on any of several earlier versions of Xcode,
This means that Xcode 4.5 handles this 'inserted' item differently
for the two devices I use. I have been wrong before, but this does seem
like a bug in Xcode 4.5.
This may seem obvious but you must also set your deployment target to the operating system that your device is running.
So if you upgrade to iOS 6, it will set your deployment target to iOS 6. You'll need to deploy to 5.1 if the device you are testing on still runs 5.1.
My issue finally got resolved by checking to make sure that the productName attribute in the /* Begin PBXNativeTarget section */ section of my project.pbxproj file matched the name attribute.
Once editing it so that they were the same, Xcode finally runs the app on my device correctly!
Thanks to Max Weisel for helping me! :D
Deleting the derived data folder did not help for me.
Using Xcode 4.4.2 the only solution was to open Organizer and delete old expired and extraneous provisioning profiles on the iDevice. Then everything worked perfectly again.
This may be a red herring, but I experienced these problems when I added custom launch images before deleting the default ones. Deleting the default launch and custom images and then adding back in the custom ones fixed it for me. I'm working with iOS 6 and Xcode 4.5.2
There seems to be a few different things that can cause this very helpful error message.
For me, it was down to an incorrect "Required device capabilities" in the Info.plist. I had added a blank array item by mistake (on top of the the architecture, armv7).
Deleted the blank array item and now everything is fine!
I had this problem and nothing really helped except:
My problem started after changing the contents of my info.plist and no reverting had helped.
What solved it for me was:
Create a vanilla info.plist in a brand new project
replace the old info.plist with the new
renaming it (like app_info.plist)
Set Build Settings/Packaging/INFOPLIST_FILE to be the new one.
Make all the changes you need for your project
Hope that helps. I tried everything else suggested here and this was the only solution for me.
Facing same problem but now problem is solved, i deleted Executable file info.plist. I set it back to ${EXECUTABLE_NAME} and it worked again.. :)
In my case i just set 777 permission directly to xxx.app folder to all files and work!

Resources