Step 1: Download Cocos2d from the project website.
Step 2: Unzip the downloaded file in Step 1. If you are running Snow Leopard, it most likely will be in the downloads folder. Move the newly unzipped folder to the Desktop.
Step 3: Open Terminal and change the directory to the cocos2d folder on the desktop.
Step 4: Run the install template script.
The process is complete. Startup XCode and have fun!