Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode- Deleted images appear in simulator

Mac OS X Lion v10.7.2 Xcode v4.2.1 Build 4D502 gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)

I have a bunch of images in my resource folder, but when I delete those images and run in simulator again, the images are still there. I have completely deleted the images from the Project Editor window (not from Finder), and I used DELETE (not Remove Reference Only), and they are still showing up in the simulator. If I add new images back in (with the same names) thru the Project Editor window (not from Finder) the old ones are still being used as well instead of the new ones.

I have tried:

1) Deleting images from Project Editor window.

2) Delete app from simulator (click and hold, then delete while wobbling), then restart computer.

3) Choosing Product > Clean.

4) Choosing Product > Option+Clean.

5) Choosing Show Package Contents of .xcodeproj file, and deleting everything in the xcuserdata folder.

This is an incredibly annoying bug!

How do I tell Xcode to stop using cached images?

I am newbie, so something like "Clean Targets" does not mean anything to me, unless you give me the instructions on how to do it as well.

Thanks

EDIT:

Here is another option we all missed, which might do the same thing as deleting the /Simulator/../Applications folder: In the iOS Simulator menu, there is an option called Reset Content and Settings ... it never occured to me that the simulator was a separate app from Xcode, so I never thought to check menu items while simulator had focus!

like image 440
jsherk Avatar asked Jan 11 '12 14:01

jsherk


People also ask

How do I clear my Xcode simulator?

To delete individual, available, simulators it's easier to do so through Xcode. Go to Window > Devices and simulators, then select the Simulators tab. You can right-click on any simulator and select 'delete' to get rid of it.

Where does the iPhone simulator store its data?

type: ~/Library/Application Support/iPhone Simulator.

How do you refresh iPhone simulator?

ctrl+cmd+z. Click the reload button image.

Where is the Documents folder in iPhone simulator?

# Open application folder in Finder First, copy the path to the app folder from Xcode console. Then open Finder, click on Go -> Go to Folder and paste the application directory path. You will now be able to browse all the files in your application folder.


Video Answer


1 Answers

Manually removing the build folder may help. Clean does not always do this properly, for reasons unknown. The build folder used to be in the project directory, but now (also) exists in ~/Library/Developer/Xcode/DerivedData/


Solved by original poster:

Oh wait I had a brainstorm because of your suggestion above, and from Terminal I used: find . -name 'myimage.png' 2> /dev/null and I found the secret hidden cache! It is in my user library here: ~/Library/Application Support/iPhone Simulator/4.3.2/Applications/ Just delete everything in the Applications directory. May also need to do this one as well: ~/Library/Application Support/iPhone Simulator/5.0/Applications/

like image 158
mvds Avatar answered Sep 19 '22 11:09

mvds