Why does Xcode successfully build & copy my application, but won't launch it? - iphone

Developing an iPhone application on Xcode 4.5.2. Device: iPhone 4.
I was preparing my application for sending it to someone through testflight. I created a distribution profile and certificate for this. I did it following this: https://stackoverflow.com/a/11917884/555690
Anyway, recently, Xcode is unable to launch my project. When I press Run, it will successfully build and copy the files to the device, but when attempting to launch it, it will send an error:
Error launching remote program: No such file or directory
(/Users/Me/Library/Developer/Xcode/DerivedData/MyGame-xxxxxxxxxxxxxxx/Build/Products/Debug-iphoneos/MyGame.app/MyGame).
I'm not sure why is this happening.
A very similar question is this: Xcode successfully builds my target, but does not run the product, however, it seems to be more oriented to OSX instead of iOS, and the solutions there haven't helped me either. Also, I do get an error (he doesn't get an error).
If I run the app in the device (without Xcode), it works fine.

Yes, this happens a lot in the new Xcode.
One recipe that should work is:
disconnect the device from computer
delete app from device
reset the device
quit the xcode (not just by closing the project, quit the program)
in Finder go to ~/Library/Developer/Xcode/DerivedData
(Library folder is hidden: you can open Finder->Go->Go to Folder...)
delete all subfolders there
empty the trash
reconnect the device
open the project
now you should be able to run the app on the device again

Related

xcode 4.5 app can not run in device No such a file directory error [duplicate]

I'm getting a weird bug on Xcode 4.5. When i tried to run my application on Ipad 2 from xcode with iOS 6, I'm getting this error.
I done the following methods to run the application, but no luck.
Cleaned the project and run
Restarted the device
Restarted xcode
I have a valid certificate in my machine and the application is installing on the device but it's not launching automatically. What could be the issue ?
Thanks in advance
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

Jailcoder how to

I just tried to get my own app on my iPhone without a developer account. The following are steps I did:
I patched Xcode and my project (Currency.xcodeproj) with JailCoder
I want to build the project with "iOS device" in Xcode. But I got a error message like "no device found". So I ran it in the emulator and I got the currency.app-file in /Users/Dogan/Library/Developer/Xcode/DerivedData/Currency-gjxrulouxbmjslbzslsplyehgfgm/Build/Products/Debug-iphonesimulator
SSH to iPhone in /var/mobile/Applications
Creating a new folder named FADE9826-4878-4458-B5BE-90AD4EB60FDF (I have to take a valid UDID. Have I use to specific tools to create a UDID? I have the UDID from an other example). I also created a directory in this folder with the name "Documents".
chown -R mobile FADE9826-4878-4458-B5BE-90AD4EB60FDF
scp -r Currency.app root#IP-ADRESS-OF-IPHONE:/var/mobile/Applications/FADE9826-4878-4458-B5BE-90AD4EB60FDF/
Restarting Springboard in SSH with "killall SpringBoard"
I got the app, but it doesn't work. Every time on click, it crashes and kicks me to the home screen. Had I missed something?
You missed that simulator builds don't work on iPhones, because they are built for the wrong CPU type. Simulator builds are Intel x86 apps, and the iPhone has an ARM CPU.
There might be other problems (I don't know how jailcoder works) but there's no way you're getting the simulator build running on the phone.
After downloading Jailcoder and going through the guided patch of Xcode and then patching your project, if your device is plugged into your computer, select the target type (where you can select simulator, iOS Device, etc.) and there should be a listing of your device's name.

Getting message 'could not launch application' while launching the application

I have created the .ipa file of the application. I have installed it the device via iTunes. It is getting installed on the device but when I launch the application it shows the message "Could not launch application". I have added the deviceId to provisioning profile. Please give me some suggestion on this.
This happens to me some times but it just couldn't launch the app when I get onto my device and scroll over to the screen where the app would be it is there and if I manually launch it on my own it still works... I don't know what causes it, I wish I could help.
Delete your same previous application from iPAD, Now delete all profile and install fresh copy of your application. i hope it seems working....
Same problem i got while creating iPA file. I have solved issue in this way.
First of all check you have previous build in your device. Then you need to relaunch your xcode, build and clean your project using CMD+SHIFT+K then create iPA file and try to install in device. Make sure that you have deleted all previous instances of application and if possible then restart your device. One more thing check same provisioning profile is available in your xcode through Organizer.
This works fine for me.

Installing iPhone app onto device from Xcode, no files installing with app

I've just set up a new computer and now trying to install my app onto my device through xcode. I've installed the certificates, developer provisioning files, etc..
The app is being installed onto my device, but none of the .png files are being loaded. So my app has the UIButtons and UILabels but nothing else is showing up in my app. Even though the simulator is running the app perfectly.
This app was just installing fine on my old computer to my device, with all the files included. Same version of Xcode and I'm not aware of any changes to settings I made that would have caused this.
No issues or errors when building the app, everything looks good.
Xcode 4.2.1, iPhone 4S 5.0
Thank you
There's sometimes strange things like that which cache themselves in the DerivedData or BuildIntermediates folders of your Xcode project so rebuilding doesn't actually get any changes through. You may want to try Product > Clean and then build again, and then if nothing changes jump into the Xcode Organizer (Window > Organizer) and delete the Derived Data from the project. This will force a reindex of all the project files and any trace of prior builds will be deleted. It should then pick up all of the images as listed in your Copy Bundle Resources build phase(s).

iPhone testing on device

With my iPhone connected to my mac via 30-pin connector (standard apple/iphone cable) I of course test and run my app with Xcode building it to run on the device.
For some reason though, when I build and run, it installs on my device but doesn't go further than the loading screen of the app with Default.png showing.
Then if I stop the build in Xcode it quit the application, then I run in manually on my device and the new build is there for me to test, but I just don't know why I have to do that and it doesn't just run past the loading screen when building?
This happened to me once after I added some certificates. I removed the build directory (MyApp/build/) and then did a clean and then build again, and everything miraculously worked. You might try that.