美文网首页iOS逆向iOS DeveloperiOS 开发
Mac10.11&Xcode7.3安装Mactheos和

Mac10.11&Xcode7.3安装Mactheos和

作者: ask_ME | 来源:发表于2016-07-01 18:07 被阅读1909次

本文借鉴与越狱开发:用iosOpenDev配置越狱开发环境 编写第一个hello world,记录在安装theos和iosOpenDev各种坑.如果有多个xcode请对应安装.

安装工具包括:

1. 安装Macports

MacPorts:安装包管理工具(主要是安装dpkg,将APP打包成Debian Package),直接点击下载安装,完成后在终端输入命令

sudo port -v self update

如果报错selfupdate does not accept string arguments请改为

sudo port selfupdate

更新完后输入命令

sudo port -f install dpkg

如果报错The Xcode Command Line Tools don't appear to be installed,需要安装xcode命令行工具,操作如下

xcode-select --install

或打开xcod->偏好设置->更多开发工具,选择对应版本的command line tool下载安装,然后重复错误前步骤.
macports安装错误集
如果还是安装不成功的话就安装homebrew吧

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install dpkg

2. 安装theos

如果你有多个xcode请执行一下命令进行选择,我这里遇到一个坑,如Xcode 2.app,需要对空格转义(\空格),配置makefile也是一样.查看Xcode

system_profiler SPDeveloperToolsDataType

将Location:后面信息copy到下面命令中

sudo xcode-select -s /Applications/XcodeName.app/Contents/Developer

环境变量

export THEOS=/opt/theos

这里推荐使用以下theos版本,其他版本可能缺少部分文件导致异常错误

git clone -b stableversion https://github.com/haorenqq/theos/ $THEOS

配置ldid替换Xcode的codesign,下载附件

cd 创建空文件夹
git clone git://git.saurik.com/ldid.git
cd ldid
git submodule update --init

将附件中的openssl 文件夹放到 ldid 文件夹下,打开ldid中make.sh,将sudo xcode-select --switch /Applications/Xcode5-**.app,改为你选择的xcode

./make.sh
cp -f ./ldid $THEOS/bin/ldid
sudo chmod 777 /opt/theos/bin/ldid

配置cydiaSubstrate,一个能够hook任何进程并修改代码的插件,运行theos自动化脚本,如果你不适用theos创建文件的话可以忽略此步骤.当然感谢这位网友提供的theos包含bootstrap.sh,新的theos貌似没有了

/opt/theos/bin/bootstrap.sh substrate

使用pp助手,ifunbox或scp等工具将/Library/Frameworks/CydiaSubstrate.framework/􏲜􏹆􏶁􏸱􏲞􏽸􏳁􏳂􏲟􏲨􏸯􏲞􏲨􏲠􏲜􏹆􏶁􏸱􏲞􏽸􏳁􏳂􏲟􏲨􏸯􏲞􏲨􏲠􏲜􏹆􏶁􏸱􏲞􏽸􏳁􏳂􏲟􏲨􏸯􏲞􏲨􏲠􏲜􏹆􏶁􏸱􏲞􏽸􏳁􏳂􏲟􏲨􏸯􏲞􏲨􏲠cydiasubtrate拷贝到/opt/theos/lib/libsubstrate.dylib(注意名字改了),当然你也可以执行下面步骤安装完iOSOpenDev后将/opt/iOSOpenDev/lib/libsubstrate.dylib拷贝过来
此时theos已经安装成功了,你可以测试一下

/opt/theos/bin/nic.pl

关于theos的使用请自行脑补


3. 安装iosOpenDev

将上文附件里Specifications文件夹,里面应该有8个文件,iPhoneOS开头的四个文件放到/应用程序/Xcode/Content/Developer/Platforms/IphoneOS.platform/Developer/Library/Xcode/Specifications文件夹下(如果没有,请自己创建一个),iPhone Simulator 开头的另外四个文件放入/应用程序/Xcode/Content/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications文件夹下(如果没有,请同样创建一个)。
另外在/应用程序/Xcode/Content/Developer/Platforms/iPhoneSimulator.platform/Developer/文件夹下创建usr文件夹,usr文件夹下再创建一个名为bin的文件夹.
下载iosOpenDev,点击安装,commad + l查看安装信息;
基本上打开对应的Xcode就可以看到iosOpenDev的模板了.当然对于iosOpenDev的使用可以参考上面提到的越狱开发:用iosOpenDev配置越狱开发环境 编写第一个hello world.

相关文章

网友评论

  • 835ca9d36c43:我的机器是Mac Sierra 10.12.6+Xcode 7.3, 安装到最后一步,双击iOSOpenDev-1.6-2.pkg,系统提示不明身份开发者是否要安装,点好之后,什么界面也没弹出来。
    theos已经确认安装成功,可以用命令行创建实例。
  • 游城十代2dai:问下使用 captain 的那个模式,不能修改 UIKit 那部分的东西么?
  • dadahua:~/.bash_profile, ~/.bash_login or ~/.profile. 这3个文件你在你电脑中看是否能找到,
    你好,我怎么都找不到这三个文件,请问下是怎么回事呢,谢谢

本文标题:Mac10.11&Xcode7.3安装Mactheos和

本文链接:https://www.haomeiwen.com/subject/qdtqjttx.html