1.创建证书
实用工具-钥匙串访问。然后在菜单栏里点击钥匙串访问-证书助理-创建证书来打开向导。
证书名称必须为iPhone Developer,将类型设定为代码签名,勾选”让我覆盖这些默认值”,之后就一路Next。
2.环境配置
首先确认已退出Xcode,然后开始修改配置文件:
打开“终端”(1-4步都是在终端中执行)
(1)修改 SDKSettings.plist
先备份原文件:
cd /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/
sudo cp SDKSettings.plist SDKSettings.plist.orig
进行编辑:
sudo vi SDKSettings.plist
将以下两段中的YES改为NO
<key>CODE_SIGNING_REQUIRED</key>
<string>YES</string>
...
<key>ENTITLEMENTS_REQUIRED</key>
<string>YES</string>
(2)修改 Info.plist 文件
同样先备份原文件:
cd /Developer/Platforms/iPhoneOS.platform/
sudo cp Info.plist Info.plist.orig
进行编辑:
sudo vi Info.plist
将全部的XCiPhoneOSCodeSignContext 修改成 XCCodeSignContext,一共有 3 处。
(3)在桌面上新建并编辑名为script的脚本:
cd ~/Desktop
vi script
输入以下内容:(点击“i”进入编辑模式)
#!/bin/bash
cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/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
保存并退出(点击Esc,输入:wq)。
授予这个脚本执行权限并执行它
chmod 777 script
./script
运行成功会输出类似结果:
223+1 records in
223+1 records out
111648 bytes transferred in 0.002678 secs (41692099 bytes/sec)
(4)生成脚本
执行命令:
mkdir /Developer/iphoneentitlements401
cd /Developer/iphoneentitlements401
curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
mv gen_entitlements.txt gen_entitlements.py
chmod 777 gen_entitlements.py
如果上面的代码运行有问题,也可以在/Developer目录下新建一个entitlements.py文件,并把下面的代码复制到该文件中,最后赋予777权限:
#!/usr/bin/env python
import sys
import struct
if len(sys.argv) != 3:
print "Usage: %s appname dest_file.xcent" % sys.argv[0]
sys.exit(-1)
APPNAME = sys.argv[1]
DEST = sys.argv[2]
if not DEST.endswith('.xml') and not DEST.endswith('.xcent'):
print "Dest must be .xml (for ldid) or .xcent (for codesign)"
sys.exit(-1)
entitlements = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>%s</string>
<key>get-task-allow</key>
<true/>
</dict>
</plist>
""" % APPNAME
f = open(DEST,'w')
if DEST.endswith('.xcent'):
f.write("\xfa\xde\x71\x71")
f.write(struct.pack('>L', len(entitlements) + 8))
f.write(entitlements)
f.close()
(5)Xcode中的设置,以下步骤需要在每个工程中都设置一次。
1.工程设置,步骤如图:
2.脚本设置,将下面的代码添加到Phase中:
export
CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
/Developer/iphoneentitlements401/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
至此配置全部完成,接下来就可以连接iOS设备进行程序调试了.
- 大小: 19.3 KB
- 大小: 58.5 KB
- 大小: 62.4 KB
分享到:
相关推荐
xcode 4.2 免证书真机调试配置 1、根据《XCode 4.2 免证书调试之生成本机证书.rtf》制作代码签名证书 2、把“Info.plist”拷贝到“/Developer/Platforms/iPhoneOS.platform/”目录下,把原来的文件重命名 3、把...
xcode4.6免证书真机调试.doc
xcode 16.1真机调试包
Xcode iOS 16真机调试包 开发调试 iOS16适配
xcode 4.5.2 免证书真机调试 生成ipa 教程二.docx
xcode 4.5.2 免证书真机调试 生成ipa 教程.docx
这是16的真机调试包,文件直接解压放到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Xcode3.2.6破解免证书真机开发调试
今天集体推送iOS14,第一时间更新了Xcode,鉴于老项目还是用的旧版本Xcode维护,在此上传Xcode12中的 iOS14真机调试包 非beta版
Xcode12 14.1真机调试包 经实测iPhone7 Xcode10.3 14.1可以安装应用但是无法在Xcode中启动无法调试
xcode 真机调试包 13.0.zip
iOS 真机调试包 支持iOS 16.1-16.3 系统 下载完直接拖入Xcode,然后重启Xcode,连接真机调试。
iOS 15.5系统真机调试包,可以解决xcode调试高系统机型问题
xcode 12.5 iOS 14.5 真机调试包
iOS 15.0的真机调试文件,放到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 目录下重启XCode即可。
xcode 11.2 真机调试包 xcode 11.2 真机调试包 xcode 11.2 真机调试包 xcode 11.2 真机调试包
iOS Xcode 13.3真机调试包 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 拖入该地址
xcode真机调试所需,从xcode9.2解压获得,使用时解压到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport即可
本人亲测,可以在ios5.1.1的越狱后的ipod上完美运行