Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
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
@hidsh

This comment has been minimized.

Copy link

@hidsh hidsh commented May 31, 2018

Good gist! Works fine for my Mac! thx!

@deadlyicon

This comment has been minimized.

Copy link

@deadlyicon deadlyicon commented Jun 5, 2018

this fixed my files set to open with VLC having generic white icons :D

I also did this brew cask install qlvideo >D

@lastgleam

This comment has been minimized.

Copy link

@lastgleam lastgleam commented Oct 4, 2018

you are my savior. thanks!

@dgaff

This comment has been minimized.

Copy link

@dgaff dgaff commented Oct 4, 2018

Wow. Thanks so much for this.

@snowyoneill

This comment has been minimized.

Copy link

@snowyoneill snowyoneill commented Nov 21, 2018

Danke! Fixed my preview issues right up.

@albertofwb

This comment has been minimized.

Copy link

@albertofwb albertofwb commented Jan 8, 2019

that works.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Mar 22, 2019

Thank you so much! Fixed it in a matter of seconds.

@johnwyles

This comment has been minimized.

Copy link

@johnwyles johnwyles commented Mar 29, 2019

The touch command effectively does nothing (since they are all directories) so you can lose that part

@Jeronimystro

This comment has been minimized.

Copy link

@Jeronimystro Jeronimystro commented Apr 17, 2019

Help! It made it worse! Instead of just Stickies having a generic icon, now Safari, Mail, Messages and Daylite all have generic icons too!

Suggestions anyone?

@Jeronimystro

This comment has been minimized.

Copy link

@Jeronimystro Jeronimystro commented Apr 24, 2019

Hey, @ismyrnow. The command you posted initially made the situation way worse on my 2018 MBP, but after a couple of restarts many icons since slowly returned - including Stickies - either after restarting the computer or subsequent launches of the app, but some have remained stubbornly generic. Messages for example. Can you help?

@Jeronimystro

This comment has been minimized.

Copy link

@Jeronimystro Jeronimystro commented Apr 29, 2019

@ismyrnow. UPDATE: All my app icons have since restored themselves, gradually. Most if not all the remaining ones repopulated when the app in question was opened.

@aminmirr

This comment has been minimized.

Copy link

@aminmirr aminmirr commented Jun 1, 2019

most of them didn't fix and the error is this:
touch: /Applications/(name of an app).app: Operation not permitted

@ing0mar

This comment has been minimized.

Copy link

@ing0mar ing0mar commented Jul 15, 2019

I made an account just to thank you op. I screwed up my Pock icons by clearing the cache and have no knowledge of how these things work

@widiu7omo

This comment has been minimized.

Copy link

@widiu7omo widiu7omo commented Nov 10, 2019

thanks. it works on Mojave 10.14.6

@remicarreiro

This comment has been minimized.

Copy link

@remicarreiro remicarreiro commented Mar 25, 2020

Not working for me in Catalina :( Still seeing generic icons for my video media associated with IINA

@arrichter

This comment has been minimized.

Copy link

@arrichter arrichter commented May 20, 2020

Fixed my white icon problem for .rar files on Catalina 10.15.4
Thanks!

@shanshine-01

This comment has been minimized.

Copy link

@shanshine-01 shanshine-01 commented Jun 16, 2020

Didn't work for me, but then again I have a slightly different problem - my app icon is showing up on top of the generic document icon.
Screenshot 2020-06-16 at 11 09 34 PM

Anyone knows how I can remove that white paper behind the icon?

@arrichter

This comment has been minimized.

Copy link

@arrichter arrichter commented Jun 16, 2020

My PDFs look just as ugly. I even tried replacing the .icns file in Adobe Acrobat.app/Contents/Resources - no such luck. For whatever the reason it always shows a white sheet of paper behind the icon.

However I did find this:
https://community.adobe.com/t5/acrobat/acrobat-icon-displayed-incorrectly/td-p/11154816?page=1

@ranrodriguez

This comment has been minimized.

Copy link

@ranrodriguez ranrodriguez commented Jun 24, 2020

The same thing is currently happening with me, as with @shanshine-01 but in my case it is with Word. The only way I have been able to fix it is with manually changing with icon in Get Info. No idea what to do.

@captain-carrot

This comment has been minimized.

Copy link

@captain-carrot captain-carrot commented Jul 16, 2020

OSX Catalina, my Thunderbird icon had disappeared. Tried this and, although numerous Operation Not Permitted messages, the t/bird icon reappeared. Great!

@dardo82

This comment has been minimized.

Copy link

@dardo82 dardo82 commented Aug 3, 2020

I've a blank icon in the Finder
for the Time Machine's drive.
I've shortened your command
but it didn't work as expected.

sudo sh -c "rm -frv /Library/Caches/com.apple.iconservices.store;\
find /private/var/folders/ -name 'com.apple.*icon*' -exec rm -frv {} \;"

It even made the specific Google Drive Icon disappear...
although it came back by just restarting the Finder again.

@HenkMutsaerts

This comment has been minimized.

Copy link

@HenkMutsaerts HenkMutsaerts commented Nov 25, 2020

My girlfriend updated to Big Sur two weeks ago, and recently her Dock icons disappeared, together with some icons in the system preferences pane. Running the suggestion at the beginning of this thread:

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

did fix the Dock icons. Let's hope that she will be spared from more initial Big Sur bugs, happy I didn't update yet... Any other suggestions are welcome!

@joshuanathanson

This comment has been minimized.

Copy link

@joshuanathanson joshuanathanson commented Feb 5, 2021

Worked for me, Mojave 10.14.6, thanks!

@surabhiagarwal-in

This comment has been minimized.

Copy link

@surabhiagarwal-in surabhiagarwal-in commented Jun 2, 2021

Thanks a bunch! All my css files had somehow gotten associated with Tor and the onion wouldn't go away from the file icons even when I associated them with sublime editor by force. This helped get rid of the Tor onion and get the sublime icon.

@stewlis

This comment has been minimized.

Copy link

@stewlis stewlis commented Jun 6, 2021

Does this clear the cache for all user accounts or only the one you run it under? (Update: never mind, it does!!! It’s fixed!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment