xcode4.6.1 iphone 5 ios 6 免证真机测试
1.创建证书。
如下图, 尽量就跟下图一样. 名称大小写要注意,
2.直接双击/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk 此目录下的SDKSettings.plist
将以下两段中的YES改为NO
1
|
< key >CODE_SIGNING_REQUIRED</ key >
|
2
|
< string >
YES </ string >
|
3
|
和
|
4
|
< key >ENTITLEMENTS_REQUIRED</ key >
|
5
|
< string >
YES </ string >
|
把全部的XCiPhoneOSCodeSignContext修改成XCCodeSignContext,好像有三个。。
4. 打个二进制补丁。
cd ~/Desktop
vim script
打上下面内容.
1
|
<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>
|
授予这个脚本执行权限并执行它
chmod 777 script
./script
正常的话应该输出(具体的数字可能有差别)
1
|
231+1
records in
|
2
|
231+1
records out
|
3
|
115904
bytes transferred in 0.001738
secs (66694555 bytes/sec)
|
把下面的内容一行一行的执行。
1
|
<b> mkdir /Applications/Xcode.app/Contents/Developer/iphoneentitlements
|
2
|
cd /Applications/Xcode.app/Contents/Developer/iphoneentitlements
|
3
|
curl
-O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
|
4
|
mv gen_entitlements.txt
gen_entitlements.py
|
5
|
chmod 777
gen_entitlements.py</b>
|
6。将工程配置中所有的Code Signing选项全部设为Don't Code Sign.
我这边设置为我的证书名好像也没事...
7.
添加自定义的生成后脚本
在Build Phases中添加一个Phase,右下角的Add Build Phase,然后单击Add Run Script,输入以下脚本
1
|
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
|
2
|
if [ "${PLATFORM_NAME}" == "iphoneos" ]
|| [ "${PLATFORM_NAME}" == "ipados" ]; then
|
3
|
/Applications/Xcode.app/Contents/Developer/iphoneentitlements/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" ;
|
4
|
codesign
-f -s "iPhone
Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
|
5
|
fi
|
到此OK了,
要注意两点,害的我一直不成功.
1. 要完全退出你的xcode, 再重新启动xcode.
2. 你的越狱的iphone要装AppSync.
form :http://my.oschina.net/williambao/blog/116133