最近要给网站做个IPHONE客户端口, 只是测试先, 所以就选择越狱机子, 再随便玩下。
在此做个备忘录。
1.创建证书。
如下图, 尽量就跟下图一样. 名称大小写要注意,
<key>CODE_SIGNING_REQUIRED</key>
<string> YES </string>
和
<key>ENTITLEMENTS_REQUIRED</key>
<string> YES </string>
- 1.
- 2.
- 3.
- 4.
- 5.
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,好像有三个。。
4. 打个二进制补丁。
打上下面内容.
<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>
- 1.
授予这个脚本执行权限并执行它
231+1 records in
231+1 records out
115904 bytes transferred in 0.001738 secs (66694555 bytes/sec)
- 1.
- 2.
- 3.
5. 准备自定义的生成后脚本
把下面的内容一行一行的执行。
<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>
- 1.
- 2.
- 3.
- 4.
- 5.
6. 将工程配置中所有的Code Signing选项全部设为Don't Code Sign.
我这边设置为我的证书名好像也没事...
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
- 1.
- 2.
- 3.
- 4.
- 5.
到此OK了,
要注意两点,害的我一直不成功.
1. 要完全退出你的xcode, 再重新启动xcode.
2. 你的越狱的iphone要装AppSync.