If you're an iOS developer you may be running multiple versions of Xcode on your development machine, for example Xcode 4.4 and Xcode 4.5. Since these have the same dock icon, it can be easy to get confused about which one is running!
Mac OS actually makes it very simple to change a dock icon.
1. Create your icon: I just made a 512*512 pixel PNG in Photoshop. By tweaking the hue of the standard XCode icon, I've made this evil red XCode! Save it as a PNG.
2. Open the PNG file in Preview, Cmd+A to select all and Cmd+C to copy
3. Right/Command click on XCode.app and choose Get Info
4. Click on the icon at the top left of the Info window, and Cmd+V to paste.
You're done! Here are my two versions of Xcode running side-by-side in the dock.