Search This Blog

Friday, February 18, 2011

How to compile and upload iPhone app for iPhone device 3GS 4.2.1 in Xcode 3.2.5

Step 1. Install 'AppSync' on iPhone 3GS 4.2.1

Step 2. Create a certificate

Step 3. Edit '/Developer/Platforms/iPhoneOS.platform/Info.plist'
In this file, replace every key 'XCiPhoneOSCodeSignContext' with 'XCCodeSignContext'

Step 4. Now, it can compile iPhone app for iPhone device 3GS 4.2.1 with Xcode 3.2.5

Step 5. Go to the menu Project > New Build Phase > New Run Script Build Phase. In the window, copy/paste this for 'iPhone Developer':

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
/Developer/iphoneentitlements312/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

If you made a key for 'iPhone developer', you can use following:

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
/Developer/iphoneentitlements312/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

No comments:

Post a Comment

Blog Archive