您的位置:首页 > 移动开发 > IOS开发

xcode4.6.1 iphone 5 ios 6 免证真机测试

2013-03-22 21:58 253 查看
最近要给网站做个IPHONE客户端口, 只是测试先, 所以就选择越狱机子, 再随便玩下。

在此做个备忘录。

1.创建证书。

如下图, 尽量就跟下图一样. 名称大小写要注意,



2.直接双击/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk 此目录下的[b]SDKSettings.plist[/b]

将以下两段中的YES改为NO



<key>CODE_SIGNING_REQUIRED</key>
<string> YES </string>
和
<key>ENTITLEMENTS_REQUIRED</key>
<string> YES </string>


[b][b]

[/b]

3. 双击/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/下的[b]Info.plist[/b][/b]
[b]把全部的[b]XCiPhoneOSCodeSignContext 修改成 XCCodeSignContext,好像有三个。。[/b][/b]

[b]


[/b]

[b]4. 打个二进制补丁。[/b]



[b] [b]cd ~/Desktop [/b][/b]

[b]

[b]vim script

[/b][/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

正常的话应该输出(具体的数字可能有差别)

231+1 records in
231+1 records out
115904 bytes transferred in 0.001738 secs (66694555 bytes/sec)


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


6。 将工程配置中所有的Code Signing选项全部设为Don't Code Sign.

我这边设置为我的证书名好像也没事...








[b] 7. [/b]

[b] 添加自定义的生成后脚本 [/b]

[b]

在Build Phases中添加一个Phase,右下角的Add Build Phase,然后单击Add Run Script,输入以下脚本
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了,
要注意两点,害的我一直不成功.
1. 要完全退出你的xcode, 再重新启动xcode.
2. 你的越狱的iphone要装AppSync.

[/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: