xcode4.6.1 iphone5 ios6免證真機(jī)測試
最近要給網(wǎng)站做個(gè)IPHONE客戶端口, 只是測試先, 所以就選擇越獄機(jī)子, 再隨便玩下。
在此做個(gè)備忘錄。
1.創(chuàng)建證書。
如下圖, 盡量就跟下圖一樣. 名稱大小寫要注意,
- <key>CODE_SIGNING_REQUIRED</key>
- <string> YES </string>
- 和
- <key>ENTITLEMENTS_REQUIRED</key>
- <string> YES </string>
2.直接雙擊/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk 此目錄下的SDKSettings.plist
3. 雙擊/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/下的Info.plist
把全部的XCiPhoneOSCodeSignContext 修改成 XCCodeSignContext,好像有三個(gè)。。
4. 打個(gè)二進(jìn)制補(bǔ)丁。
打上下面內(nèi)容.
- <b>#!/bin/bash cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/ dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255 printf "xc3x26x00x00" >> 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</b>
授予這個(gè)腳本執(zhí)行權(quán)限并執(zhí)行它
- 231+1 records in
- 231+1 records out
- 115904 bytes transferred in 0.001738 secs (66694555 bytes/sec)
5. 準(zhǔn)備自定義的生成后腳本
把下面的內(nèi)容一行一行的執(zhí)行。
- <b>mkdir /Applications/Xcode.app/Contents/Developer/iphoneentitlements
- cd /Applications/Xcode.app/Contents/Developer/iphoneentitlements
- curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
- mv gen_entitlements.txt gen_entitlements.py
- chmod 777 gen_entitlements.py</b>
6. 將工程配置中所有的Code Signing選項(xiàng)全部設(shè)為Don't Code Sign.
我這邊設(shè)置為我的證書名好像也沒事...
7.添加自定義的生成后腳本
- export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
- if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "ipados" ]; then
- /Applications/Xcode.app/Contents/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
到此OK了,
要注意兩點(diǎn),害的我一直不成功.
1. 要完全退出你的xcode, 再重新啟動(dòng)xcode.
2. 你的越獄的iphone要裝AppSync.