Recover Xcode project from iphone? - iphone

My computer recently crashed and I lost my entire Xcode project. However, the project is till sitting on my iphone, is there any way i can recover it?

I'm sorry but I think this is no way to recover your project from iPhone, as it contains already compiled version.

Unfortunately this is a painful lesson about version control and backups
There is no way to get the Xcode project back from the compiled app.

if you can access your iPhone and could get to the folder where the app was installed then you will fnd couple of files you might be able to use. Esp *.png files. There are also some *nib files - but I don't know if/how they can be loaded back into xCode somehow.
You will also get the *strings files back. But possibly most important in this folder there are also *h files of your project.
So I guess that will save you already couple of hours - all you need is to get to your iPhones app folder. I use iPhone Explorer, but anything else should work too.
ps don't know how it can be done on a non-jailbroken phone though
good luck!
use TimeMachine in the future - its simple and doesn't burdon your MAC during development...

Related

Re-generate device support symbols in Xcode

I've accidentally deleted the different folders in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport, as a result, Xcode is giving me a lot of trouble.
How do I re-generate these folders?
As far as I know it should be something that Xcode generates automatically when you plug in your iPhone, but it doesn't. Any suggestions on what I can do?
How abou just redownloading Xcode? usually Xcode doesn't change stuff within the app.

Iphone app not showing properly on the device

i have an app which works perfectly on the simulator but on the device in is not as expected.
Animations are misplaced and other bugs. But on the simulator it works fine.
My question is how to fix this bug.
Here is list of things I already tried:
Restart Mac.
Restart Xcode.
Clean Project.
Rename Project.
Delete app from iPhone.
Restart iPhone.
Shut down iPhone.
Clean and build in Xcode.
I really don't know where is the problem.
Thank you for your help.
Would be really appreciated.
Notice: App is correctly signed.
Make sure your files typed correctly and are case sensitive. The Simulator is not case sensitive but the iPhone is.
Did you ever move code/xib files into different groups or directories? Sometimes there is a old copy of the file in the original directory after the move. I've had scenarios in which those old files caused the old code to executed when switching between build settings.
If there are duplicate files, make sure you delete those copies at the old location, or those that you don't intend to be used. For instance, if your original directory as ~/Work/App/Resources and the new directory is ~/Work/App/Resources/xibs then delete the duplicated files from ~/Work/App/Resources
Make sense?
Now, after deletions, if files start to show up as red in XCode, that means XCode cannot find them anymore (maybe you deleted one too many, or who knows the state of your workspace). If this happens, use the "File Inspector" to confirm that the location and path XCode is using for the file is correct.

XCode error "The application bundle does not contain a valid identifier."

Recently, after upgrading to Lion and Xcode 4.2.1 I am getting this error when trying to run my app on my iPhone 4S:
"The application bundle does not contain a valid identifier."
My identifier is indeed valid, and I have been able to run my app with this identifier earlier.
The problem might appear when I change computers.
I have two computers that I am using to code my app, and I am using Dropbox to keep track of my files.
Restarting XCode, my mac and my iPhone does not work.
Cleaning the target and rebuilding does not work.
The only thing I have been able to do to fix it is to create a completely new project and moving my files. This made things work until I swapped computer. Now I am in the same trouble again.
Any idea? Anyone?
Three suggestions:
Check that your developer key is in both computers
Did you try to update the project? There is a strangly-named key in the middle bottom under the project's properties. Try this.
I had similar issues. I found that some things weren't updated when I updated osx and xcode. To get out of the situation, I would suggest creating a new project and copy paste code, files and build settings. This might seem stupid, but you know apple is not good at creating IDE's. You might just get your self lost in the undocumented settings.

XIB actualization problem

I'm facing a weird problem dealing with Xcode. When I run my project using simulator I got the correct xib showing, but when I select my iPhone as target, it shows an older version of that xib... I'm going crazy with this, I have tried to clean targets, deleting and reinstalling the app on iphone, :^S
Please could anybody help me with this issue?
Thanks a lot and sorry for my english.
When Xcode installs development builds of iOS apps on the simulator and on the device, it copies all files from the .app bundle into the target directory for the app in the simulator or on the device. However, it does not remove old files. This can sometimes cause strange effects.
For example:
You have MyView~ipad.xib and MyView.xib for iPhone, you install the app and run it on the device, now you decide to delete the MyView~ipad.xib so that it will just use the MyView.xib same as iPhone, you test this in the simulator and it works fine but when you put it on the device again it still uses the old iPad xib file, but how when it's not even in the project any more? Well the old file still exists in the filesystem on the device until you actually delete the app off the device.
This can happen when you remove files from the project or rename them to something else, the old files will still be there and especially if you have fall-back beaviour or how iOS can look for other suffixes automatically like #2x or ~ipad - this can easily cause confusion. Check for this whenever you notice strange effects like old versions of files seem to resurrect themselves, or it works on one device but not the other.

Reading a file from a hard drive in iPhone simulator

Is it possible to read a file (from my normal file system) into a iPhone App running on the iPhone Simulator?
I understand that the iPhone itself has not got a (user accessible) file system but this is simply for testing and will only ever be run in the simulator.
The file will be a text file that can be edited while the application is running, it will be read every-time a method is called.
Yes, you can, and it doesn't matter where it is. Just give it an absolute path name when you load it (Xcode won't recognize a different working directory when running the simulator).
Yes, you can if your file is within your app folder
~/Library/Application Support/iPhone Simulator/User/Applications/ [your app folder] /Documents
No. Your app is running in its own sandbox on the phone. It's not allowed to read or write outside of it.
Edit: I think CiNN is correct. As long as your code stays on the simulator, you shouldn't have problems working with a file on your local drive.
I personally think that the easiest way would be to enter "file:///" in Safari within the simulator, if thats what your looking for.
It should also be noted that you can do this in reverse -- you can grab the files off your hard drive that your application created in the simulator. This is a good way to check out your results (data, images, whatever) without having to build a data "viewer" into the application.
FYI 'newer' sds versions will do this... Search for iPad and you will find it. (for obvious reasons I cannot give more details here) good luck.