5

I'm starting with an app that has foo.png as a resource, and the app is installed (either in the simulator or on the device). If I delete foo.png, do a clean build, etc., and install, then it still shows up in the bundle on the simulator or device!

But I know the file isn't in the bundle before copying to the simulator or device (for example:

  1. I can see it's not there in the build folder.
  2. If I delete the app from the simulator or device, and then install, then foo.png doesn't show up on the simulator or device.

So it seems that when updating, it doesn't replace the app bundle; instead, it only copies new files and replaces updated ones. (I can confirm that it does, in fact, copy and replace files properly.)

Why isn't it replacing the entire app bundle?

Jesse Beder
  • 33,081
  • 21
  • 109
  • 146

2 Answers2

2

If you update your application through iTunes using an ad hoc build you will see that your .app bundle will be replaced completely and old resources, such as the foo.png file described in the original post will be removed.

markusn82
  • 41
  • 5
0

Reset the simulator, go up to the menu and then click reset simulator. I always have that problem with databases on the device. You will have to delete it on the device. Just a quirk that I've experienced as well.

Rudiger
  • 6,749
  • 13
  • 51
  • 102
  • But this means that I can't remove any files when updating my app - that can't be right! – Jesse Beder Mar 05 '11 at 21:55
  • @Jesse But this is how the current build and deploy process works. If you think the current behaviour is not correct you should file a bug. http://bugreport.apple.com – Matthias Bauch Mar 06 '11 at 00:32
  • @fluchtpunkt, where is that documented? – Jesse Beder Mar 06 '11 at 00:54
  • and remember, I mean removing files from the bundle, *not* removing files from the `Documents` folder – Jesse Beder Mar 06 '11 at 00:56
  • Jesse, I've seen this quirk too. "Reset simulator" is the way to fix this on simulator. – occulus Mar 07 '11 at 01:12
  • @occulus, 1) I'm more worried about the device, and 2) it doesn't "fix" this on the simulator to reset it - it just deletes the app and reinstalls, which isn't what I want to do. In other words, my goal isn't just to get the right data on my device or simulator; it's to do that *while updating from an old version*. – Jesse Beder Mar 07 '11 at 22:06