MacOS – How to reset Messages application settings in Mountain Lion

accountsicloudmacosmessages

I upgraded from Lion to Mountain Lion and, when I started the Messages app for the first time, it imported the iCloud account, a Google Talk account and to old iChat accounts I used in the past.
I removed all the unwanted accounts and only left the iCloud one, but the problem is that it is someway duplicated.

Two iCloud accounts appear, one active, with the right account set-up, and the other one in inactive, and I can't delete it. If I configure it with the same data from the first account, or with data of a different account, the second one becomes active and the first one becomes inactive, and I couldn't fin any way of removing one of the two.

Is there a way for resetting the app configuration so that I can restart the program from scratch?

Best Answer

Messages.app uses many files in various locations for storing information.
To completely start from scratch, all these files must be deleted.

  1. Delete the preference files (there are many of these):

    find ~/Library/Preferences -name "*iChat*" -delete
    
  2. Delete caches:

    rm -rf ~/Library/Caches/com.apple.Messages
    
  3. Delete chat database:

    rm -rf ~/Library/Messages
    

Remember to take a backup before deleting files.