Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I have an application that I'd like to change the icon for. If I drag and drop the new icon into the app's Contents/Resources/ via the GUI, the app updates ok.

However, if I cp the icon in the terminal the icon doesn't update, and the original icon is still displayed or a slightly broken version of the original is shown.

What else do I need to do to allow the .icns to be updated via the terminal (I need to be able to script this for a project.)

Many thanks.

share|improve this question
add comment

1 Answer 1

I'd check two things:

  1. Make sure that filename.icns is the exact filename referenced in Contents/_CodeSignature/CodeResources and Contents/PkgInfo

  2. Make sure that the permissions for filename.icns are correct. If you run ls -l from within Contents/Resources/, you should see that filename.icns has the owner root and the group wheel, with permissions listed as -rw-r--r--. If you do not see that, the commands you'll need to run to fix this are:

    sudo chown root:wheel filename.icns

    sudo chmod 644 filename.icns

If you'd like a little more info on permissions check out the following links:

http://www.macinstruct.com/node/415 (helpful guide on permissions and ownership)

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/chown.8.html (chown manual)

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/chmod.1.html (chmod manual)

share|improve this answer
    
Unfortunately that's already the case with the permissions / access modes correct, when the file is copied via the shell. BTW, user ownership permissions don't come into play with the drag-drop method. The owner was listed as username:admin –  Slomojo Jul 12 '13 at 0:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.