-
-
Save fabiofl/5873100 to your computer and use it in GitHub Desktop.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
"in reality..." Uhmmm.
Tbh in reality all we know is that Finder's internal logic has embedded the icon somewhere. The trouble is, where. We know it's not really in that file Icon\r
because the actual file system doesn't register the file size.
The worst problem here is that neither representation is "in reality". They're both views through different abstraction layers, but it's safe to say only that those icon data bytes went "somewhere". Unfortunately that doesn't give us a thing to stand on.
All completely undocumented. All completely unreliable.
If you can script it somehow and make it reliable, applause for you.
On High Sierra, deleting com.apple.dock.plist
worked for me. However, a couple of native apps stubbornly refused to work. The Notes and Screen Sharing apps still have the default app icon.
Update:
I fixed those apps by removing them from the dock and then re-adding them. It worked after that.
@jasonm23 thanks
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
after that restart your mac.
wahlaaah.. all restore and back to normal
This worked really well! Thank you @zigang93.
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
after that restart your mac.
wahlaaah.. all restore and back to normalThis worked really well! Thank you @zigang93.
Works!
Here for better readable and discovering the shell-snippet again:
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
@jasonm23 @andreiborisov i'm interested in changing icons via cli, doing some more debugging, found these articles:
- https://superuser.com/questions/298785/icon-file-on-os-x-desktop
- https://apple.stackexchange.com/questions/6901/how-can-i-change-a-file-or-folder-icon-using-the-terminal
The first one clarifies the 0 bytes size of Icon\r
: the file is actually stored in the resource fork
and finally this tool looks promising (although i haven't tested it myself) https://github.com/mklement0/fileicon
EDIT: i tried the tool and it works for me on Monterrey, although i still need to rebuild the cache and restart dock:
rm /var/folders/*/*/*/com.apple.dock.iconcache
killall Dock
That's right, but I'm several hours away from the last live test. It's something I can check again in the morning.