Xcode4.2破解

来源:互联网 发布:普通人如何利用大数据 编辑:程序博客网 时间:2024/05/16 23:54

本文PDF下载地址:http://download.csdn.net/detail/qq348931837/5908911;跟多详情请下载PDF文档

 

 

网上有不少关于xocde3.x真调试的文章,但鲜有xcode4.2相关的资料。参考了一些文章,终于可以在xcode4.2上进行真机调试了,在此记录下。

我会分几步来说明。值得说明的是,要想真机调试,ios device必须事先越狱 :-)

1.创建证书,这个没什么好说的,网上资料一大堆,只要别写错名字就好,证书名一定要为 iPhone Developer

2.破解ios sdk及其xcode的相关配置文件(双击配置文件就可以打开,注意SDKSettings.plist有权限控制)

修改/Developer/Platforms/iPhoneOS.platform目录下的Info.plist文件,将其中的 XCiPhoneOSCodeSignContext 都改为XCCodeSignContext

修改/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk目录下的SDKSettings.plist文件,修改如下字段:

<key>CODE_SIGNING_REQUIRED</key>
<string>NO</string>

<key>ENTITLEMENTS_REQUIRED</key>
<string>NO</string>

3.破解xcode二进制文件。建立一个crack文件,内容如下:

#!/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 -n working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support
#!/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 -n working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support

然后执行 chmod +x crack

执行./crack,没错误就正常

4.修改xcode工程配置文件

1) 下载脚本

打开终端,执行如下操作

cd  /Developer
mkdir xcode-crackcd xcode-crackcurl -Ohttp://www.alexwhittemore.com/iphone/gen_entitlements.txt
mv gen_entitlements.txt gen_entitlements.py
chmod 777 gen_entitlements.py

2) 禁用Xcode自动的签名操作

将工程配置中所有的Code Signing选项全部设为Don't Code Sign,如图。可能需要先点击“All”让这个选项显示出来


3)添加自定义的生成后脚本

在Build Phases中添加一个Phase,右下角的Add Build Phase,然后单击Add Run Script,输入以下脚本(如图)

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ];then
/Developer/xcode-crack/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

5。打包应用程序,生成ipa文件

在xcode上选择product菜单,选择Build For ---> Build for Achiving,就能成ipa文件了。如图:

可以将这个文件拖到itunes,就可以生成一个ipa文件,如图:

原创粉丝点击