由于自己手机没有越狱,有需要真机测试,穷,舍不得99刀,就翻了各种帖子,终于搞定了免证真机测试。
1.创建证书。
如下图, 尽量就跟下图一样. 名称大小写要注意,
2.直接双击
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk 此目录下的SDKSettings.plist
提示1:如果双击后,无法进行下面操作,那么你就复制此文件到桌面,在桌面修改好后,覆盖目录下的文件,记得备份和权限问题哦。
1 | <</code> |
2 | <</code> |
3 | 和 |
4 | <</code> |
5 | <</code> |
3.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/下的Info.plist
提示2:如果无法操作,同提示1所示操作。
把全部的XCiPhoneOSCodeSignContex
4. 打个二进制补丁。
打上下面内容.
1 | #!/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 |
授予这个脚本执行权限并执行它
1 | 231+1 records in |
2 | 231+1 records out |
3 | 115904 bytes transferred in 0.001738 secs (66694555 bytes/sec) |
提示3:这里我当时操作时,遇到了问题,因为对于VIM命令不懂,这里给展示哈具体的操作哈。
输入
打开终端,把下面的内容一行一行的执行。
1 | 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 |
6。
我这边设置为我的证书名好像也没事...
7.
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.