MacOS – What are Icon\r files and how to delete them

dropboxmacosxcode

I notice that within my xcode project I see an Icon\r file. When I go to the folder where the project is from finder, I don't see this file. I believe this is some sort of hidden file that I should not be able to see. However, xcode sees this file and it's causing some error on my project when I try to archive it.

The following is the error that I got:

error: Codesign check fails : /var/folders/7l/l93zzs6n4h14qb7rmj5r7zn00000gn/T/GtLyx05w1O/Payload/stryker.app: a sealed resource is missing or invalid
In architecture: armv6
resource added: /private/var/folders/7l/l93zzs6n4h14qb7rmj5r7zn00000gn/T/GtLyx05w1O/Payload/stryker.app/www/Icon
resource missing: /private/var/folders/7l/l93zzs6n4h14qb7rmj5r7zn00000gn/T/GtLyx05w1O/Payload/stryker.app/www/Icon

Is there a way I can delete this file? I can't delete it from within xcode. When I drag and drop it into trash nothing happened and when I right click it, it doesn't give me the option to delete the file.

The project folder is inside my dropbox folder so I think dropbox is the one that put the file there.

Any idea on how I can delete this? Thank you.enter image description here

Best Answer

The Icon\r file is used when you're about to change folder's icon: when you change the icon, it is not actually applied to the folder itself but rather to the Icon\r file inside the folder in question.

You can remove the file via terminal with rm $'Icon\r'

Alternatively, if you want to delete the file through Finder, you must make it visible first; also something you can do via terminal: SetFile -a v $'Icon\r'


Somewhat related info on how to change file's or folder's icon via Terminal: Changing a file or folder icon using the Terminal

… And be sure to see Icon? file on OS X desktop on Super User.