2024年3月22日发(作者:)

xcode4破解与免费真机调试和转成ipa的方法

测试环境:

XCode 4.0.2 + iTouch 4_iOS_4.3.3(已越狱)

(据说iTouch需要用Cydia安装AppSync for 4.0+)

以下为详细步骤:

1.确保XCode关闭。

2.「生成本机证书」

2.1. 应用程序-> 实用工具->钥匙串访问

2.2. 菜单:钥匙串访问->证书助理->创建证书

2.3. 输入证书名称:iPhone Developer(请原样输入,不要试图自己乱改名字),并选择覆盖默认值 ,其他默

2.4. 点击继续

2.5. 序列号填1,有效期365(不要试图超过365),点击继续

2.6. 输入电子邮件,随便乱填,比如

点击继续

2.7. 2048RSA,点击继续

2.8. 保持默认(1级2级打钩,3级„签名‟打钩),点击继续

2.9. 勾选代码签名,继续

2.10.不勾选基本约束扩展,继续

2.11.默认(RFC822为上面填的邮箱地址),继续

2.12.默认(登录),继续 。至此证书创建完毕。

3.「XX XCode」

3.1. 复制以下内容到文本编辑中,保存为

view sourceprint?#!/bin/bash

(此电子邮件拥有者要红了) ,

cd /Developer/Platforms/rm/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System

in/Contents/MacOS/

dd if=iPhoneOS Build System Support of=working bs=500 count=255

printf "x8fx2ax00x00" >> 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 al

/bin/mv working iPhoneOS Build System Support

chmod a+x iPhoneOS Build System Support

mkdir /Developer/iphoneentitlements30

3.2. 在终端中执行该sh脚本

3.3. Finder中打开/Developer/iphoneentitlements30文件夹,复制以下内容,保存为gen_

view sourceprint?#!/usr/bin/env python

import sys

import struct

if len() != 3:

print "Usage: %s appname dest_" % [0]

(-1)

APPNAME = [1]

DEST = [2]

if not th('.xml') and not th('.xcent'):

print "Dest must be .xml (for ldid) or .xcent (for codesign)"

(-1)

entitlements = """

application-identifier

%s

get-task-allow

""" % APPNAME

f = open(DEST,'w')

if th('.xcent'):

("xfaxdex71x71")

(('>L', len(entitlements) + 8))

(entitlements)

()

3.4.将该py文件属性修改为777:打开终端,cd /Developer/iphoneentitlements30回车,chmod 777

gen_回车

至此,XCode XX完毕。

4.「 修改/Developer/Platforms/rm/」

4.1. 用文本编辑打开,将以下内容加在第一个下面一行

view sourceprint?PROVISIONING_PROFILE_ALLOWED

NO

PROVISIONING_PROFILE_REQUIRED

NO

4.2. 搜索中的 XCiPhoneOSCodeSignContext,全部替换为 XCCodeSignContext,保存plist

5.「修改你的工程」(你以后真机debug其他工程时,都需要对新工程进行以下操作)

5.1. 用XCode打开你的项目,找到你项目的文件,添加”SignerIdentity”项,其值为”Apple

iPhone OS Application Signing”.保存。

5.2. 找到你项目的Build Settings-Code Signing Identity,把Debug和Release下面的分支都删除,然后将

Code

Signing Identity的值改为iPhone Developer

5.3. Build Settings-Code Signing Entitlements的值改为xxx/。其中xxx是你的工程文件夹

名。 这个文件目前还没有,下一步我们就要建立这个文件。

5.4. 在你的工程目录,右键New File -> iPhone OS -> Code Signing -> Entitlements,新建一

个“”,点Finish,然后打开此文件,里面只有一项:Can be debugged,将其Value改为YES,

保存

6. 至此所有步骤完成,接下来就是连接你的iOS设备了。如果第一次连接,XCode还不认识你的设备,需要什

么Collect一下

信息之类。总之连接上后,你可以发现XCode的build scheme里面可以选择到你的iOS设备。然后直接debug

即可。

Have Fun!