I've created a prototype app which uploads a bunch of photos to a webserver. Everything works fine in the simulator. But when I want to try it on an actual device it does not find the images. I've included them under the resources group in Xcode. Anyone?
Best
–f
Check the filenames. The filesystem on your mac is most likely not case-sensitive, but the filesystem on the actual device is case-sensitive. So make sure the filenames match exactly.
Try cleaning the project with Build->Clean all Targets, and manually remove the app from the device. Then try building again.
Related
I set up InAppSettingsKit and wish to have only certain volatile settings available from within the app. These would not be the same as what is found in settings.app from springboard. I added a bundle, InAppSettings.Bundle and created the appropriate plist files. It works as expected in the simulator but acts as though my new bundle does not exist on the device. The device shows only the same as the settings.app properties in settings.bundle/ root.plist.
How do I get the new bundle into users' devices without deleting and reinstalling the app?
In this case, it was a "case" of developer error. Apparently the case of the characters in the name of a file are not specific in the simulator. The files in my bundle were not correctly named. I had root.inApp.plist when it should have been Root.inApp.plist. Worked in simulator,not on the device.
Once I realized this and renamed the file, the device read and displayed the correct file as intended.
That was a waste of about 5 hours chasing my tale. I Hope this info helps someone avoid this same annoying oversight.
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.
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.
i developed an app which is meant to read books(pdf book reader).i loaded 25 books(total size of 320MB) into the app using absolute path.all the books are been seen in the simulator and also i can load all the books into my device through xcode(build and run).
my requirement:
when i loaded the above obtained ipa file into the same device or other device which are in ad-hoc distribution using itunes , it is strange that only few books are being seen in the device.
note: i made sure that all the books are present in the .ipa file,i deleted old app in the device which i run via xcode. the device is in ad-hoc distribution.
while code signing i used the iphone developer certificate.
is it necessary to use distribution certificate instead iphone developer certificate which i feel that might be one reason for my problem?
plz anyone suggest me with exact solution to the scenario.
tnx in advance
I know I have seen problems going from simulator to live device. The simulator is not case sensitive, but the device is. Recheck all your actual files in bundle vs what you are requesting when you open the file. They need to match exactly for device, but not so much for simulator.
I would also try seting the apps-Info.plst to have "Application supports iTunes file sharing" on so you could see what is in the documents folder (this is if your moving files in that area).
One problem might be as RAZ suggested that iPhone is case sensitive, but there could be other problems.
For starters I would check the that ipa does contain everything you think should be there. Take the ipa, change the extension to zip and open it. You'll get a folder containing you're app. Right click the .app and choose show package. You'll now see all the files/resources included in your app. If the files that won't load in the app are there then you'll need to provide more information about the problem.
If they're not you need to make sure xCode knows to copy them to the app resources.
You might have resources that you haven't copied into the project, and you're only referencing the files on your hard disk. Then when you make the .ipa file it's not included. Try re-importing all your resources and select "copy to project".
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.