After reading about LaunchServices in OS X, I finally found a solution, thanks for the @ peter-m tip.
To change the file association for a specific application, you can use the lsregister tool. To reregister the application, there is the -f option and unregister -u . Everything can be done with just one command:
$ lsregister -f /Applications/Xcode.app
Or if you want to unregister Xcode 5 and not touch it manually, set the associations earlier:
$ lsregister -u /Applications/Xcode5-DP5.app
lsregister is located in /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/ , so add it to $PATH
Go to OS X to make changes.
source share