Tag Archives: required

Use XCode 4.5.2 to run your app on jailbroken iDevice without CodeSigning

Well of course it s ire rewritten from the previous post (here).

Well first, simply create a certificate :
Open the Keychain app from the LaunchPad > Utilities > Keychain Access

From the menus, choose “Certificate Assistant” > create a certificate
From the window, choose Certificate Type => Code Signing
and from the Text Input above, choose a name for our certificate such as JailbreakTests (You need to remember the name ;))

Now the fun part updated !!
Open a terminal and type (or cmd+c/cmd+v)
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
sudo cp Info.plist ~/Desktop
open ~/Desktop/Info.plist

(it will launch XCode) now replace every XCiPhoneOSCodeSignContext => XCCodeSignContext
sudo cp ~/Desktop/Info.plist Info.plist

Now the third part,
from the current directory change to ./Developer/SDKs/iPhoneOSX.Y.sdk with X.Y egal to 5.1 for example

cd Developer/SDKs/iPhoneOS5.1.sdk/
and then :
sudo cp SDKSettings.plist ~/Desktop
open ~/Desktop/SDKSettings.plist

sudo cp ~/Desktop/SDKSettings.plist SDKSettings.plist

and replace every YES from every *_REQUIRED to NO

And finally,
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns
cd iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
sudo nano create.sh

and copy/paste this code to this the nano which opened :
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
printf “\xc3\x26\x00\x00” >> working
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
/bin/mv working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support

type ctrl+o and ctrl+x

now, type:
sudo chmod +x create.sh
sudo ./create.sh

You will se something like
55+1 … in
55+1 … out
27712 bytes transfered

Restart Xcode if it was open, if not, just launch it !

Open your project and change the build configuration from every Code Signing to “Don’t Code Sign”
This step will make Xcode not code signing the code

Now, we will code sign ourself the code, to enable it we execute this code :

mkdir -p /Developer/iphoneentitlements
cd /Developer/iphoneentitlements
curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
mv gen_entitlements.txt gen_entitlements.py
chmod 777 gen_entitlements.py

and now, in the project, on the target add a new custom build phase to run script:
and copy/paste this code and replace iPhone Developer to the name you choose when you made your certificate:

export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ “${PLATFORM_NAME}” == “iphoneos” ]; then
/Developer/iphoneentitlements/gen_entitlements.py “my.company.${PROJECT_NAME}” “${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent”;
codesign -f -s “iPhone Developer” –entitlements “${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent” “${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/”

This code will auto sign the application

If your iDevices was not configure to do development, you need to open the Organizer and select your iDevice. Then choose “Use for development”

That’s it, you can now choose the iDevice instead of the emulators