Tag Archives: ios

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/
now
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
so

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}/”
fi

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

Use Xcode 4.3.2 to build and run app on jailbroken iDevices

If you have jailbroken iDevices like me and no Apple Developer Certificates (quite expensive and I did not have finish my apps :p)

It is very easy to configure Xcode to do so.

Simply follow these steps :

First of all, we need 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 open a shell and type the following command

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/

edit the Info.plist with nano

sudo nano Info.plist

and replace every XCiPhoneOSCodeSignContext => XCCodeSignContext

The third part is to remove code signing requirement :
from the current directory change to ./Developer/SDKs/iPhoneOSX.Y.sdk with X.Y egal to 5.1 for example
so

cd Developer/SDKs/iPhoneOS5.1.sdk/

and then

sudo nano SDKSettings.plist

and replace …_REQUIRED > NO to YES (SIGN_REQUIRED, etc…)

Now, we have to binary patch the
App :

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

copy and paste the following code in it :

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

now press ctrl+o and ctrl+x
and use

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/iphoneentitlements51
cd /Developer/iphoneentitlements51
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/iphoneentitlements401/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}/"
fi

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

Source : http://stackoverflow.com/questions/246422/how-can-i-deploy-an-iphone-application-from-xcode-to-a-real-iphone-device

Pokemon TCG Manager arrives on iOS !

You will be soon able to manage all your pokemon card on the iOS with your favorite device such as iPad or iPhone. I am currently finishing to develop the Pokemon TCG Manager available on the Android Market to put it on the App Store

An other article will also deal with “how to test apps from xcode 4.3 or 4.3.2 to a jailbroken idevice”. Quite usefull when we do not have certificates right now 😉