Here is the update of Xcode Template for pwned firmware 2.0 and open toolchain using the Final SDK.
(1) If you have not installed the open toolchain header, please refer to the this post (point 2) to install it
http://www.hackint0sh.org/forum/showthread.php?t=38389
(2) Installed the Apple's Final iPhone SDK (build 9M2199a) in Mac and with pwned iPhone OS 2.0
(3) Follow this guide to create a self-signed certificate http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Procedures/chapter_3_section_2.html
If you are already registered iPhone Developer, please create the certificate name to something else
e.g. "iPhone Pwned Developer"
(4) You should follow this to patch the SpringBoard and MobileInstallation in pwned iPhone OS 2.0 firmware. I have tested this patch using iPhone 1st generation and working fine.
http://www.246tnt.com/iPhone/#xcode
But I have made some modifications to the procedure as below, as the self created certificate "iPhone Developer" will ambiguously match with your existing certificate, if you are already iPhone Registered Developer. So I change the certificate name to "iPhone Pwned Developer" for the following procedure and the Xcode template in point 4
If you have already patched the SpringBoard and MobileInstallation, you don't need to do this again.
#/bin/sh
#assume your iPhone IP is this, change this if it is not
export IPHONE_IP=10.0.2.2
mkdir iphone_tmp
cd iphone_tmp
scp root@$IPHONE_IP:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation .
scp root@$IPHONE_IP:/System/Library/CoreServices/SpringBoard.app/SpringBoard .
cp MobileInstallation MobileInstallation.bak
cp SpringBoard SpringBoard.bak
curl -O http://www.246tNt.com/iPhone/iphone_binary_patch
curl -O http://www.246tNt.com/iPhone/SpringBoard.xcent
chmod +x ./iphone_binary_patch
./iphone_binary_patch
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
codesign -s "iPhone Pwned Developer" -f MobileInstallation
codesign -s "iPhone Pwned Developer" --entitlements SpringBoard.xcent -f SpringBoard
scp MobileInstallation root@$IPHONE_IP:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
scp SpringBoard root@$IPHONE_IP:/System/Library/CoreServices/SpringBoard.app/SpringBoard
(4) Download this template and use this command to install in your mac. The installation will go to "Application Pwned" directory of the Project Template. This template already incorporated a shell script build to codesign the binary before installation to iPhone.
curl http://cocoatouchdev.com/javacom/ToolChainTemplate_v3.zip > ToolChainTemplate_v3.zip
unzip -o ToolChainTemplate_v3.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates"
MD5 (ToolChainTemplate_v3.zip) = fd88fe59395ec530d5fc793cc9c85a1d
There is currently only one template in this update
(5) This template supports "Build and Go" to "Device and Release" only, so you have to connect your iPhone to USB cable when "Build and Go". It also supports setting breakpoint and debug iPhone program in Xcode.
(6) If you rebuild the project using this template, please uninstall any previous build using the Xcode Organizer before "Build and Go" again. This will ensure that Xcode to regenerate the application map. If you uninstall the previous build by simply remove the application icon in iPhone, your subsequent "build and go" would fail.
If you forgot to remove the previous build, your second "Build and Go" would fail as well.
(7) The source code should be in the "Classes" directory and Resources file like png should be in the "Resources" directory of the Project.
(8) There is also a Makefile in the project template, so that you can run "make" then "make install" to the /Applications/ directory of iPhone. The Makefile will make use of the Mac OS X Intel binary of ldid (from Saurik) to sign the binary before ssh to iPhone.
(9) If you want to uninstall the previous version 1/2 of this Xcode Template. You can do this by
rm -fr "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/Open Tool Chain"