初来乍到研究越狱开发,昨天中午开始上网搜索越狱环境搭建,后来查到iosOpenDev软件,是个很方便的编写插件,而且可以直接用Xcode创建的工具,便开始着手学习如何去安装
集合了网上的方法后,我安装的时候发现:
1.作者最后更新的时间是四个月前,而且并未适配Xcode 6之后的版本,所以在当前OS X 10.11.1 和Xcode 7 下造成了很多问题
尤其是大量的安装失败却得不到解答方法,很是让我懊恼
2.同时需要适配的安装工具也已经严重过期,比如theos,ldid等工具
所以根据自己的摸索,附上一篇如何安装iosOpenDev的流程:
注意:请尽量尝试在翻墙后再进行安装,有一些网址也许会被国内网络拒绝访问
1.首先安装MacPorts软件,从官网根据mac本身的版本下载
export THEOS=/opt/theos如果你选择的是用户之上的目录,需要加上sudo指令:
当安装教程有如下语句的时候sudo export THEOS=/opt/theos
- Using git:
git clone --recursive git://github.com/DHowett/theos.git $THEOS
- Alternatively, you can use svn, if you prefer:
svn co http://svn.howett.net/svn/theos/trunk $THEOS
git clone -b stableversion https://github.com/haorenqq/theos/ $THEOS
(特别感谢网名为逍遥笛子 的热心朋友 提供的分支,由于原theos最新的版本不兼容iosopendev,所以用15年的老版本,地址如下(已经得到该名朋友的同意))
sudo xcode-select --switch /Applications/Xcode5-**.app
将Xcode5**.app改为Xcode.app,下面还有一行也一样要修改(或者直接将附件的make.sh放入ldid文件夹下替换同名文件)
sudo xcode-select --switch /Applications/Xcode.app
git clone git://git.saurik.com/ldid.git
cd ldid
git submodule update --init
./make.sh
cp -f ./ldid $THEOS/bin/ldid
/应用程序/Xcode/Content/Developer/Platforms/IphoneOS.platform/Developer/Library/Xcode/Specifications
/应用程序/Xcode/Content/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications
/应用程序/Xcode/Content/Developer/Platforms/iPhoneSimulator.platform/Developer/
/应用程序/Xcode/Content/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
在终端执行~/.bash_profile
, ~/.bash_login
or ~/.profile
.这3个文件你在你电脑中看是否能找到,我是找到~/.bash_profile
这个文件,然后设置下面的环境变量
export iOSOpenDevPath=/opt/iOSOpenDev
export iOSOpenDevDevice=
非固定值,用户需要先在已经越狱的iphone上点击设置-网络-查看当前网络的IP地址,填入export PATH=/opt/iOSOpenDev:$PATH
export PATH=/opt/local/bin:$PATH
export PATH=/opt/local/sbin:$PATH
xm文件中有这样一段说明
#error iOSOpenDev post-project creation from template requirements (remove these lines after completed) -- \
Link to libsubstrate.dylib: \
(1) go to TARGETS > Build Phases > Link Binary With Libraries and add /opt/iOSOpenDev/lib/libsubstrate.dylib \
(2) remove these lines from *.xm files (not *.mm files as they're automatically generated from *.xm files)
意思是要把libsubstrate.dylib添加到工程中(在安装好的/opt/iOSOpenDev/lib 目录下),然后把xm中的内容清空。mm文件的内容会根据xm文件中的内容编译后自动生成。
之后清空.xm文件的内容,输入下列内容
- <span style="font-family:Comic Sans MS;font-size:12px;">#import <UIKit/UIKit.h>
-
- %hook SpringBoard
-
- - (void)applicationDidFinishLaunching:(id)application{
- %orig;
-
- UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"Welcome" message:@"HelloWorld!" delegate:nil cancelButtonTitle:@"Thanks" otherButtonTitles:nil];
- [alert show];
- }
- %end</span>
现在调试越狱设备,在已经越狱的手机上打开Cydia,搜索下列插件
最后打开Target-Build Settings 找到iOSOpenDevDevice选项,填入越狱手机的本地ip
点击Product- Build For -Profiling启动应用
手机会重启,之后在锁屏界面就会弹出AlertView
其他问题:
1.可能会碰到真机连接后无法编译的现象,修改build setting中的iOS Deployment Target为你的设备对应的版本即可