iPhone 真机测试设置过程(节省了$99)
我个人的环境:
系统:mac os x 10.6.2
xcode版本:官方下载的xcode_3.2.4 and_ios_sdk_4.1
首先,需要制作1个自制签字。
打开:application-实用工具-钥匙串访问
1)
2)
3)
4)
最後選擇存放在"登入"內
至此,你已经制作好1个签名了。
现在进入第二大步骤。
1)关闭xcode
2)打开:application-实用工具-终端
1,并拷贝以下代码:
#!/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 “\x8f\x2a\x00\x00″ >> working
dd if=iPhoneOS\ Build\ System\ Support of=working bs=1 skip=127504 seek=127504
/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
2,执行完后再复制粘贴下面的代码到命令行终端:(需要internet网络连接)
mkdir /Developer/iphoneentitlements30
cd /Developer/iphoneentitlements30
curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
mv gen_entitlements.txt gen_entitlements.py
chmod 777 gen_entitlements.p
3,执行完脚本后修改”/Developer/Platforms/iPhoneOS.platform/Info.plist”文件,做如下修改:
新增如下两项:
PROVISIONING_PROFILE_ALLOWED = NO
PROVISIONING_PROFILE_REQUIRED = NO
4,再用文本编辑器打开”/Developer/Platforms/iPhoneOS.platform/Info.plist”文件,将所有“XCiPhoneOSCodeSignContext”替换为“XCCodeSignContext”,保存退出。
5,打开Xcode,打开你的项目,Project>>Edit Project Setting,选择“Build”页面,Configurations和Show都选择All,找到Code Signing Identity项,将“Code Signing Identity”设为“iPhone Developer”,再将“Code Signing Identity”赋值为“iPhone Developer”(其实是个选项)。
6,然后找到你项目的xxx-Info.plist文件,添加“SignerIdentity”项,其值为“Apple iPhone OS Application Signing”.保存。
7,将iPhone接入电脑,在Xcode的Window>>Organizer中会侦测到你的iPhone.查看iPhone和你的Xcode识别正常后退出Organizer,选择编译环境为“iPhone Device-4.1”,点击"Build and Go",期间会出现让我们选择签名证书,点选“允许”后,祈祷你的iPhone屏幕亮起吧。
8,你的程序会自动下载到你的iPhone中。点触运行无任何错误提示。