Xcode 4.4 No such file found launching executable - ios

Before anyone just assumes what I am saying here, please read what I have to say.
I have read the hundreds of posts on this topic and have tried pretty much all the suggested resolutions, in no particular order:
Quitting Xcode
Deleting the derived data folder
Cleaning the project
Hard resetting iPhone
Resetting Mac
Tried a second iPhone
Different USB port
All these in 'special' order
Checked code signing attributes
"Validate Settings" returns no problems
Validation returns no problems
I am stumped when it comes to this. The only thing I can think of is actually resetting my phone, but don't see how this could help when it doesn't work on the second phone either.
Are there any other suggestions, tips, ideas on what could be causing this rather annoying bug?
UPDATE: The exact error:
Error launching remote program: No such file or directory (/Users/Username/Library/Developer/Xcode/DerivedData/ProjectName-dnfacjtdklqktcazrpfyupofdryp/Build/Products/Debug-iphoneos/ProjectName.app/ProjectName).
To get the error, I do any combination of the listed steps above, then click Run on "My Device" (an iPhone 4). Application never installs to the phone and Xcode reports the application has finished running then shows the above error.

My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
Change the deployment target to below or equal to the ios software version on your phone.
(this answer wasn't on your list) :)

Related

Why Xcode shows "This app could not be installed at this time." pop-up?

When I run the project and add the app in simulator for the first time, everything is okay. But when I run it again, Xcode prompts this message as a pop-up window at the end of compilation:
This app could not be installed at this time.
I already checked the relevant question, and tried all the advised ways to solve this issue; checking mentioned logs, cleaning project, restarting simulator, changing it, erasing all content and settings in it. Nothing works. I must erase the app and recompile it every time to open the app. Did you get the same message before? Is there any way to detect problem and resolve it? Btw, I use Xcode 9.2 at High Sierra.
This error pop-up may come up for different reasons. There is no specific reason to see it for now. In my case, a JSON file that I added to Bundle in order to provide mock data triggered this issue. This file was containing a Turkish letter in one of the keys. After I fix it, the pop-up is gone. Interestingly, earlier simulators (<=9.1) work properly if JSON file contains Turkish letter but 9.2 simulators cannot tolerate it.
Worked for me when I rebuild the project after deleting the derived data folder.
I think I may have found a solution. This all started a short time after I let Xcode update my project settings. Specifically on my CocoaPod-Subproject. I removed the pods and reinstalled them and now I am no longer getting the pop-up.

Internal API error

Since few days, every time I try to run my app on my iPhone, I get get this error message "There was an internal API error".
I'm getting this error just with one application only on my iPhone. In fact, there's no problem with the same app on simulator or on my iPad. No problem too with other apps on my iPhone...
I've tried many things mentioned in those threads:
"There was an internal API error." while running an app on any iPhone/iPod-touch device
Xcode 4.4 - There was an internal API error
like remove/re-run the app, reboot iPhone/mac, clear cache, check plist, check profiles, check build settings, restore iPhone.
I'm using xCode 7.1.1 and iOS 7.1.2
Can someone point me on what I forget to check please ?
As per my work and research I got a solution. Since I was preparing the build in manual way from product. In that case my appname.app was copying in folder from which I have to create a build, that app was not copied properly and I prepared the build and installed in my device, in that case I got this error.
I again clean the Xcode prepare the build properly and installed it, it works.
When I rename my project and delete the special character "ç", xCode success to run the app on my iPhone. It might be related to xCode 7, before there was no problem for compiling.
I also had this problem. The way I solved it was by removing the special characters from the Product Name (in Build Settings) - I had an 'æ'. Indeed, it looks related to Xcode 7, because it used to work on previous versions of Xcode.

How to fix a broken iOS Simulator (The operation couldn’t be completed. LaunchServicesError error 0.)

When I try to run my project with my favorite simulators (iPhone 5s/8.4 and iPhone 5s/9.1) I get this error, and in syslog I see:
kernel[0]: AMFI: Simulator(pid 6881) - [deny-mmap] mapped file has no team identifier and is not a platform binary: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib
This started happening after I had built and run an xcodeproject downloaded from github. My main project had been working fine and when I switched back to it, I started getting this error.
Other simulators, such as iPhone 6/9.1, work OK.
Previously, when switching back and forth between my own project and examples projects from the internet, I have seen xcode pop up a provisioning error alert, offering to fix the problem, and when I click "Fix" I am able to continue with no issue. I'm an xcode newbie and all this is quite mystifying.
I have tried to "Reset Content and Settings" of the offending simulator, Quit the Simulator, quit xcode, and rebooted. I've checked my Provisioning Profiles in Preferences > Accounts and they look fine as far as I can tell.
Using the SimDir app I found the device directory for the simulator and dragged it to the trash. After that, the simulator worked for a little while then broke again.
I found this apple article but frankly I couldn't understand it (and I'm not running Swift. This is a react-native app.)
Oh one more thing. It's weird that the syslog message mentions iOS 7.1.simruntime when I'm using the 8.4 or 9.1 simulator. The project's deployment target is 7.0 but ???.
By the way I also tried cleaning my build folder (CMD-K) and anything else relevant in this SO question and this one.
UPDATE: Like a virus, the working simulator is now getting infected. The iPhone 6/9.1 simulator worked well for a while, but now keeps getting this error (which can be 'fixed' temporarily by Reset Content and Settings). It looks like my Provisioning Profile is OK in xcode because I can run on my iPhone, and when I build an Archive of the project and validate it with Apple it validates succesfully. It's just the simulators.
A good night's sleep resolved this issue! The next day I had the error pop up a couple of times but was resolved by "Reset Content and Settings". After that day the problem has not reappeared. I have no idea why I was seeing this... The only thing I can think of is that I might have had my own project and the example project from the web open in Xcode at the same time. You wouldn't think that should cause a problem but...
If it has an Apple Watch App bundled in you should use the bundle IDs correctly, like:
com.user.app
com.user.app.watchkitapp
com.user.app.watchkitapp.watchkitextension

App installation failed: Could not write to the device

In Xcode 6.3, I got this error when trying to run an iOS project written in Swift on a real device.
App installation failed
could not write to the device.
I tried to clean the project and run again, but the same error occurs.
How can I fix this error?
Deleting the app on the device and running the project again works for me.
I did a Clean and installed my app successfully.
Product->Clean(Shift-Cmd-K)
I turned off the device and turned it on again after which I did not get such error.
OK, few things you should consider that could guide us to the problem, please check and post the answers:
is your project using capabilities? are they set correctly (should be all green)
did you try with a different project (something really simple)?
are you able to install apps from the App Store?
did you check the amount of free space left in the device?
if not, another suggestion will be using exception breakpoint, there is someone that posted an explanation how to setup it, do it and post the logs
App installation failed
I hope it helps you
Got this problem twice in one week on complete different devices.
One device had no more storage left, after deleting some apps the project installed perfectly.
The other device was fixed after rebooting the device
If you are using a free developer account you may need to uninstall some other apps you have signed.
For me it was the provisioning profile - I used distribution instead of development
My issue was an embedded framework.
Go to "Build Phases" -> "Embed Frameworks" -> Check "Copy only when installing", and it got rid of the issue for me.
For me the following did not work on iOS 11 beta 10, XCode 9 beta 6:
Restart the device
Deleting the app from the device
No symlinks were in the project
There was plenty of storage available
Deleted Derived Data and voilá, it worked again
in my project this problem happened because there was a folder with symbolic link. I removed that folder and it worked properly.
This error has many potential root causes, as can be seen by the large variety of suggested answers. The best approach to troubleshooting app installation issues like this one is usually to inspect the console of the iOS device itself, as that'll often provide much more specific error messages. In Xcode open the 'Devices and Simulators' window and take a peek at the logs of the device where your app is being installed.
In my case, the "Could not write to the device" error was being caused by this:
Feb 27 10:54:58 iPhone-7-110 installd(MobileSystemServices)[46] : 0x16f92f000 -[MIBundle _validateWithError:]: 38: Failed to load Info.plist from bundle at path /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.ebmR6U/extracted/SampleApp.app/Frameworks/SomeFramework.framework
Which clearly hints at what's actually going on. I had forgotten to set an Info.plist file for my dynamic framework target (used by the app).
I had a symlink in my project to a file outside of the project. When I deleted this symlink the install worked fine.
I was having the same error, i just deleted the project and fixed!
Go to Window -> Project and right click, and remove from projects!
In the case of your device have an app with the same bundle identifier, Xcode will throw this error.
Try to delete potential app with the same bundle identifier.
Check your provision profile, maybe you are using the app store provision profile like me. I had to change the app store provision profile to development, now it's working.
Tried all of the above answers: Deleting the app, clearing storage space, cleaning the project...
What finally worked was bumping the build number in info.plist (General > Build)
For anyone still facing this Issue:
There are so many reasons and this is one of them as it happened to me.
I've faced the same problem and I was connected wirelessly and If you are trying to install the application in wireless connecting mode (connected through same network), this might probably because of poor internet connection. Check your internet connection and try again, it works fine...
Get rid of embedded libraries, dont' just throw it in there make sure it is embedded indeed.
If you use your iPhone for debug, maybe, because your iPhone's storage space is less than your debug App.
Clean your iPhone --- Real machine
Clean your Mac --- Simulator
This looks like another time waster courtesy of Apple's amazingly high class development team. On iOS11 Xcode9 (pick your beta, any one works) this will happen randomly. Appears to be more frequent if you dare to switch apps while compiling. Just build again and stare at xcode - it'll work the second time without fail in my experience.
Apparently this message can also appear if the system clock of device where the app is being installed is too far away from the current time.
I was doing some tests with date formatters by changing my iPhone's system clock and eventually forgot to reset it to the current time. Afterwards it always displayed the same message ("could not write to the device.") whenever I attempted to run the app. Simply resetting the clock in Settings fixed the issue.
Nothing helped me. I followed the below steps,
Clean derived data folder
Quit Xcode and disconnect device
Restart Macbook
Restart Device
Open Xcode
Clean and run the project
Finally I got it working!!
I am facing same issue then solved out follow this step and now its working.
Deleting the app from the device
Try to install another application
Remove derived data in X-code.
Restart X-Code then clean and build the project then run.
It's still not working then
Remove un-used application
Restart the device and check the Available and capacity in settings
Again app run in device
I hope its worked, enjoy it.
My problem was I had initially installed the app using a different set of developer credentials on the device. Deleting the app from the device fixed it.
Maybe it can be due to the following error App installation failed. No code signature found. In my case after a project clean the description of the error switched to "No code signature found".
In my case I created two frameworks but they had the same bundle identifier.
This caused the installation to fail, so double check the frameworks bundle identifiers and make sure that each of them have a unique bundle identifier.
Environment: Xcode 10
sometime this error occurs due to wrong certificate.Please make sure your certificate.
Also this the error shown if your machine running Xcode is low on space.
Once I had to load an App Container for debugging purposes into an iPad, said operation failed because the container was too big (18 GB) for this device (16 GB minus the OS), so that I desisted the task and completly forgot about it, leaving the failed installation in the device. Later, when trying to install a different application this error appeared, once I got rid of the failed app installation, everything got back to normal.
Basically, your Ipad might be low in storage.
One reason this can happen is if your app bundle contains broken symlinks.

Why does my app work in the simulator but get stuck on the splash screen when I run it on my iPhone?

My app runs fine on the simulator. However, when I run it on my iPhone, it gets as far as displaying the splash screen and then just stays there. It's an iPhone 3GS and the software version is 5.0.1. That's what happens when Debugger = None. When Debugger = GDB, I get an error message, 'Thread 1: Program received signal: "SIGABRT"', which I have learned can mean almost anything. I'm running Xcode 4.2.1.
I'm coming off a long hard night of battling with this error message, which appeared seemingly out of nowhere in a stable mature app. I tried to roll back with time machine, I deleted the Derived data for my project in Organizer a few times and did some of the other stuff recommended in this thread.
XCode 4 hangs at "Attaching to (app name)"
It got ugly. For a while, I couldn't even reboot my machine. Eventually, I was able to relaunch finder and suddenly the Simulator was working again. Two more pieces of information, I used to have to click allow in two dialog boxes when running on my phone but now it's only one (the one about code signing, I forget what the other one was about). Second, I find all the build architecture target stuff confusing but I set all my Base SDKs to be latest iOS. Lastly, I tried Product --> Clean and then Build but that didn't fix it. As you may have gathered, I'm getting my butt kicked. Any help would be much appreciated.
Dessie
Many times I have experienced Xcode going "crazy" with a physical device connected. At times I saw the behavior you describes; other the app simply refused to start;
In all of those cases, I could fixed it in either of two ways:
disconnect the iphone and connect it again;
reboot the device.
This is a very common problem that is easily fixable.
1) remove the app from the device
2) reboot the device
3) close Xcode and you must restart, logging out will not work

Resources