my text files no longer in project still show up on phone - iphone

I am getting old files in my documents directory and not sure why.
On the simulator it works as expected. I can update the files no problem. I just delete the app. from the springboard and rebuild. I can easily verify the files are the correct ones.
But, when running on the iPhone, old versions of the files show up. I do always delete the app of course. And if I go to the project and delete the files and verify in the build phase that they are not included, they still show up on the iphone.
I have rebooted the mac and the phone, no change.
I even found under organizer how I can download the files from the iPhone and they do show the old files, but I am not sure how they got there as I don't think I am asking for them to be copied...
thx for any suggestions!

After finding the compile output, I saw that xcode was copying from a directory called "DerivedData" and then I found posts about possible issues/bugs.
Here is a link to the fix

Related

Finished running <App> on iPhone 6.1 Simulator

I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (Versión 6.0 (369.2)).
At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).
The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.
I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.
What can I do? Any idea?
1.Manually launch the iOS Simulator.
2.From the "iOS Simulator" menu, click "Reset content and settings",
3.Close and rebuild your app.
This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.
Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.
Rebuild your app and relaunch.
I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.
What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758
Go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
Run the project, this worked in the simulator.
Then Go back to the Edit Scheme and set back to LLDB.
I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).
This problem may arise due to presence of more than one info.plist file.
I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.
Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it.
Hope it helps.....
I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.
I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,
there is hope for a fix
this thing is caused by folder resources that need to be copied into the bundle
Updated:
I was able to get it working again. Here is what I did..
- Cleared out the derived data folder
- Shut down the simulator app
- Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)
Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.
So there you have it.. Follow the steps above to get out of the problem.
Avoid copying folders called Resources to your bundle.

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 -- delete images are still getting built when building app

I am trying to clean up my app before I submit it for apple approval, but I have an issue. I have delete some unwanted background images but the app seems to think they are still there. I have delete the app completely from the phone but when I build it is still there. The image has been completely remove from the Mac it doesn't exist anywhere not even in the simulator folder
/Users/******/Library/Application Support/iPhone Simulator/5.0/*********/appname.app
I can't seem to figure out whats going wrong.
I have had a look at a few questions like
Xcode- Deleted images appear in simulator
but this doesn't work, I have also tried
Attempting to delete an image from Xcode 4
when it builds it just adds it back in.
Can anyone help? or advice where I can find some help?
Delete it and then, from Xcode, perform that:
Press Shift+Cmd+K
Alt+Shift+Cmd+K
It will empty your cache and clean your build folder.
Product -> Clean or ⌘-Shift-K.
In the project tree click the name of the project name, select targets and build phases tab. There will be a section named "copy bundle resources", if you can see the name of your file, delete it from there. Then follow others' solution to clear the cache and make a clean build.
Edit: Also check Xcode- Deleted images appear in simulator, I guess your question is answered there.
Have you tried cleaning your project and then building it again ? (It might still used the already built .app file when you uploaded it again to your phone)
i think thats happens because of you are deleting the reference of images so that images are still in the folder of your project so do these 3 things.
1. go to your project folder where it is saved and search those images and if you found those images in that folder than delete them.
2. clean your project. from product->clean
3. delete app from simulator
after that try again i think your problem is resolved.

Xcode 4 archive results in slow/unresponsive Organizer & pngcrush process takes up 100% cpu

sorry about the rather confusing title, but I tried to get in as much info as possible.
Problem:
I'm trying to archive my iPhone app into an ipa file for OTA testing (via TestFlightApp) - so in Xcode, I perform a Project > Archive.
After the archive is successful, it opens the Xcode Organizer to create the ipa file.
BUT as soon as Organizer is opened, Xcode becomes VERY slow & essentially unresponsive.
So naturally I open Activity Monitor to see what's going on and there's a process called "pngcrush" using up almost all my cpu (90%+) and causing Xcode process to be intermittently listed as "not responding". I can't seem to do anything in Organizer because it just keeps throwing the spinner/loading cursor.
Any ideas on how to fix this would be great! Also, I've tried setting "Compress PNG" option in build settings to NO, but problem is still there. Thanks!
Xcode 4.0.2, OSX 10.6.6
Deleting Archives will improve the responsiveness of the organizer. I guess the Organizer runs pngcrush on all archives. Perhaps one should submit this as a bug to Apple.
The Archives are saved in ~/Library/Developer/Xcode/Archives. If you want to keep the archives as backup, move them to another folder. Personally I've created a folder ~/Library/Developer/Xcode/Archives Backup to save old archives in.
This is a weird bug.
I found the way I solved it was by deleting the launch images from the bundle and then adding the images normally, though, the add files interface. If I dragged the images into the summary pane on the application target, it cause the large image to show up in the organizer preview image which PNGCrush is constantly trying to shrink.
I found it by deleting the icon and/or launch image file as well as moving the archives with the offending icon/launch image files. I also found, the launch image file was 20px too small as I trimmed for the status bar which is incorrect. (See: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5)
First of all try restarting your computer. Sometimes Xcode can get into a loop that only a restart can solve.
Secondly, have you tried letting it finish? PNGCrush is a process that compresses all the PNGs in your project to save space.
Also, try deleting your workspace file. See here:
Xcode 4 - slow performance
For some reason my Info.plist file had multiple (some invalid) entries for Icon files and Icon files (iOS 5). I removed all the items in these lists, re-added the app icon, and everything seemed to start performing well again. Hope this helps someone else!
#wolfgang's answer was right for me, and in general - clean up Organizer on all its data -
Archives
Devices
Provisioning Profiles
You can find a discussion on Apple support forums: https://discussions.apple.com/thread/3159366?start=0&tstart=0
I got to a point I had to restart the computer if I accidentally opened Organizer. Now I can breathe again.
I solved mine Organizer freeze by:
rm ~/Library/Developer/Xcode/UserData/IDEOrganizerWindowController.xcuserstate

Removing Old JPG and MP3 Files From Bundle

I think this is very basic, but still, I didn't understand what I should do here:
In my app there are many JPG and MP3 files stored in the app bundle; they are triggered and displayed upon user actions. When I change a certain file (for example, I had a photo and I wanted to change it to a new photo with the same file name instead of the one I had), I delete it from the bundle (selecting "Also Move to Trash") and then insert the new file.
In some cases (not always) the old file is simply not disappearing (!?!); If I look in the bundle I see the new photo, but when I run the the Simulator I still see the old photo (same goes with mp3 files).
anyone?
When Installing app in simulator, Xcode doesn't delete old files, which can lead some troubles like this. Just make sure to :
delete app from simulator
OR reset simulator
OR (the one I prefer) delete app directly from ~/Library/Application Support/iPhone Simulator/_version_/Applications
maybe you should delete the app in simulator and re-install it to simulator by Xcode.
Build>>Clean & Build>>Clean all targets will solve your issue.
Do these two things and then compile and run the app and you'll see the changes.