Friday, September 19, 2008

Xcode Template for pwned iPhone device updated to version 3.5.2

This Xcode Template is now updated to version 3.5.2

To install, run these in Mac Terminal (assume you have installed the Xcode in /Developer folder)


curl -O http://apiexplorer.googlecode.com/files/ToolChainTemplate_v352.zip
unzip -o ToolChainTemplate_v352.zip -d "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates"

MD5 (ToolChainTemplate_v352.zip) = 5de15c4cc9f7bab7feeafff5f121da36



There are 4 new project templates to build the command line utility for iPhone
C++ Tool (.cpp)
CoreFoundation Tool (.c)
Foundation Tool (.m)
Objective C++ Tool (.mm)


These 4 command line utility templates used wifi connection to install compiled binary in your iPhone, so you need not connect your iPhone via usb port and MobileInstallation patch is not needed.

Requirements & Info:
(1) Default use Open toolchain headers
(2) iPhone and Mac connected to wifi (you should change the IPHONE_IP in Project Settings)
(3) Open SSH and Link Indenty Editor installed in iPhone
(4) Mac's ssh key installed in iPhone
(5) Debug / Release build to iPhone folder /private/var/root (no Build & Go) and you should change IPHONE_INSTALL_DIR in the Project Settings
(6) Cannot build to Simulator

Xcode Template Version 3.5.2 adds a Static Library Template for iPhone
To build the Universary Library for i386 and arm
First build it on "Device" "Release"
Second build it on "Simulator" "Release"
Then the Universary Library binary will be in the project directory
To examine the content of the Universary Library binary, run ./otoolprint.sh in the project folder


Open Tool Chain Application
This template uses open toolchain headers provides a starting point for any application without Interface Builder.

Requirements and Info:
(1) No Interface Builder
(2) Default use open toolchain headers
(3) For pwned iPhone / iPod Touch with patched MobileInstallation
(4) codesign certificate "iPhone Pwned Developer" installed in Mac
(5) XCode SDK Info.plist Setting has removed Provisioning Profile requirement
(6) Cannot build to Simulator


View-Based Application
This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a nib file that contains the view.

Requirements and Info:
(1) Default use official iPhone SDK headers
(2) For pwned iPhone / iPod Touch with patched MobileInstallation
(3) codesign certificate "iPhone Pwned Developer" installed in Mac
(4) XCode SDK Info.plist Setting has removed Provisioning Profile requirement

Window-Based Application
This template provides a starting point for any application without Interface Builder and provides a minimal iPhone application with a single view, ready for customizing.
This is a good starting point for your first application. In the UIView subclass, you can implement methods to draw content on the screen and to respond to touches. In a more full-featured application, you typically add a view controller to handle data and to manage rotation.

Requirements and Info:
(1) No Interface Builder
(2) Default use official iPhone SDK headers
(3) For pwned iPhone / iPod Touch with patched MobileInstallation
(4) codesign certificate "iPhone Pwned Developer" installed in Mac
(5) XCode SDK Info.plist Setting has removed Provisioning Profile requirement

Updated Notes
If you have "security policy error" after Build & Go. Do these steps

(1) Install a new free app from App Store in iPhone (not sync from iTunes)
(2) Launch that newly purchased free app and then close it.
(3) Reboot your iPhone (that is power off and on again)
(4) Launch the app again that you have Build & Go in Xcode to iPhone.

10 comments:

Anonymous said...

The link to download the tool chain template doesn't work (cocoatouchdev...). Could you provide another one please ?

javacom said...

links updated

Unknown said...

I tried the 'View-Based Application' template and I was amaze to see my first running application on my IPod Touch after building it with XCode. Before, I
was always receiving the message "Error from Debugger: Error lauching remoteprogram: security policy error.".

Now, since my goal is to build in XCode the sample application 'BubbleLevel' from
Apple web
site
, I would like to know what magic trick is perform inside your profile to avoid
the error. My hope, is to apply the same modification to the sample project et
make it run on my iPod.

Here's what I got until now:

- An iPod Touch 2.1 pwned with MobileInstallation patched.
- A signing identity. I just follow the instruction on Apple web site
- And finally, but not least, the modification mention in your other post
[Firmware 2.1] How to skip provisioning profile for iPhone SDK
when doing a 'Build an Go' in XCode.


Finaly, did I need to mention that here I'm just tring to avoid the 99$ tax fee to have the right to build and run an app on my iPod Touch.

Before using your profile, I was signing the app during build phase (Target> Add>New Build Phase>New run script build phase) with the following script:

platform=/Developer/Platforms/iPhoneOS.platform
allocate=${platform}/Developer/usr/bin/codesign_allocate
export CODESIGN_ALLOCATE=${allocate}
codesign -s "Bob" -f ${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${EXECUTABLE_NAME}


But, unfortunatly, I didn't have any success with it.

Thank's for your help.
Bye.

Unknown said...

Wow! by looking a bit more closely at your blog, I found the 'magic trick' I was looking for inside your template.

It was just a matter of adding the following two line at the end of the 'Info.plist' of the project.

<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>


Now I'm able to 'Build and Go' the Apple's sample application.

Thank you very much.

Bye.

Anonymous said...

Apple iPhone OS Application Signing

didn't help to me

I still get security policy error

charlie said...

Can't get it to work. after build phase of a view project from pwn Applications I get two identical alert boxes from xcode that say
"ApplicationVerificationFailed"

my configuration is as follows:
1) ssh-keys id_rsa.pub is in /var/root/.ssh/authorizedkeys and I am able to ssh into the device via wifi without a password using this key.

2) I created a self-signed iPhone Pwn Developer code sign certificate. Xcode accepts this and build and signs the code without complaint.

3) I defined added two user defined keys in the project settings so that it now reads:

IPHONE_INSTALL_DIR = /Applications/tmp/
IPHONE_IP = 10.0.2.6
PROVISIONING_PROFILE_ALLOWED = NO
PROVISIONING_PROFILE_REQUIRED = NO

4) I made a directory /Applications/tmp on the iphone

5) I downloaded a free app from the app store, ran it, and restarted the phone.

6) other unrelated info: I am able to compile and run c code on the iphone and sign it with ldid. But I have not yet succeeded in transfering a built app to the iphone and getting it to appear on it's desktop.

charlie said...

update on my last post.

I reinstalled mobileInstallation and started a new view project.

this time build and Go worked!

I do have a lesser problem now however. When I try to build & go my previous view app xcode gives a double alert box saying the application is already installed.

but when I look in /Applications on the iphone the aplication is not there. Is there some sort of registry that gets fouled up. I have tried restarting the iphone but the behaviour persits. How do I make it forget about this deleted app?

charlie said...

Okay one more question.

when I build and go in release mode, the xcode status bar says it is in GDB mode. tried touching all the sources to force a rebuilt but no change in the GDB.

not sure if this is related to the GDB stauts or is just some problme in my code but after it installs, I get a black screen with the application running. After I exit this with the home button I then can restart the app.

Anonymous said...

Does someone know how one could create (if it's not already) the same Xcode c++ template tool but for iPhone0S3.x.x headers, instead of using the toolchain's ones ? Cause actully the c++ headers are already installed whitin Xcode. Thanks a lot

Christian

Unknown said...

i got an error saying
cannot create extraction directory while unzipping