I have just uninstalled a program from my new mac. The program was making itself default to open all .r files. I installed a new program, and I maked it default for opening .r files, but the old icon of the files remains. The icon of the old program is stil at every .r-files.

How can I update the icons of the .r-files, so they view the icons of the new program? And why do this icon still exist at my mac, can I remove the icon of the old program?


6 Answers 6


You can try to rebuild LaunchServices database from Terminal:

/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

Path to lsregister on Mavericks is:


  • That doesn't work on mavericks'
    – UpAndAdam
    Commented Apr 8, 2014 at 0:52
  • @UpAndAdam I edited my answer. Commented Apr 8, 2014 at 6:38
  • Thanks for the update! Will try tonight and upvote accordingly!
    – UpAndAdam
    Commented Apr 8, 2014 at 14:30
  • lsregister on macOS 10.12 Sierra exists at the filepath as stated by @florin, and it executes without any error message, but it has no effect. Also restarting the Finder and the whole system brought no effect. I had changed the association of .TXT (plain text) from TextEdit to TextWrangler and back again to TextEdit, but it still shows the TextWrangler icons for the text files.
    – porg
    Commented Nov 9, 2016 at 13:33
  • 1
    Maybe sudo lsregister … would work. Suspect that because the command line contains the argument -domain system, which I assume needs admin rights. Though I did not get any error message hinting that way but maybe this lsregister is implemented so minimally without any feedback because as a framework helper it's probably not intended for being run non-programmatically. I assume the user caches of LaunchServices were properly cleared, but not the system caches. Nevertheless found a working solution for macOS Sierra 10.12.1, see apple.stackexchange.com/a/260487/11510
    – porg
    Commented Nov 9, 2016 at 16:19

On macOS Sierra 10.12.1 the lsregister solution provided by @Mateusz Szlosek hasn't worked.

But this solution worked: Reset icon cache on MacBook

Nevertheless, changing the default application for a file type via Finder's "Open with…" causes no immediate refresh of icons on the Desktop and in the Finder windows. This is a bug.

Some criticism at the end: As a long time Apple user I always preferred the instant feedback and GUI refresh of macOS as opposed to Windows, where you had and still have to do a lot of manual refreshing & more burdens/precaution for the user due to a lack of cross process sync/awareness (i.e. renaming a file in Explorer while it is open in another app, will cause you problems, still in 2016).

Instant cross process interaction of all stock apps and all apps using standard frameworks is what's so fine on the Mac, i.e. Re-enabling a network interface and Safari automatically loads the content of an idle browser tab, Renaming a file in Finder while it was opened hassle free, Changing an icon and its updated in every view instance (Finder, file dialog of apps, icon in app's title bar), etc.

Hate to see these qualities vanishing. Apple clearly neglects its professional Mac users over its iOS users and their Cloud services. With iCloud Apple perfects cross device sync but does not deliver the perfect synchronism within the Mac as it once did.


For Yosemite 10.10.4 use:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
  • Not working for me.
    – Ariel
    Commented Aug 6, 2015 at 12:04
  • Not working for me as well on OS X 10.10.4
    – Camaleo
    Commented Aug 8, 2015 at 8:27
  • This command did nothing until I restarted the machine. After restart, it got rid of the previous association but didn't link the new one. Odd.
    – Izhaki
    Commented Nov 20, 2015 at 23:15

I just "Force Quit" (command ⌘ + option ⌥ + esc) Finder and the errant icons were changed when it reloaded.


the above solution didn't worked for me ... so this is what I have tried and it worked ... I am explaining this here because if the above solution is not working for someone then he/she can just reboot their mac in Safe Mode login and then shutdown and boot in to normal mode ... Problem solved :)


In the terminal, paste the following code and hit Enter:

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

Reference: Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .