MonkeyDev官方安装文档:https://github.com/AloneMonkey/MonkeyDev/wiki/%E5%AE%89%E8%A3%85
1.安装HomeBrew
终端输入指令
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
选择源后安装
更多安装方式可以参考安装HomeBrew(100%成功)
2.安装theos
在终端输入以下命令安装theos
sudo git clone --recursive https://github.com/theos/theos.git /opt/theos
安装ldid(如安装theos过程安装了ldid,跳过)
brew install ldid
这边遇到ldid一直安装失败。卸载重新安装HomeBrew后就成功安装ldid了。
3.安装Xcode
去App Store安装
4.安装MonkeyDev
在终端执行安装命令安装MonkeyDev
安装命令
sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/AloneMonkey/MonkeyDev/master/bin/md-install)"
卸载命令
sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/AloneMonkey/MonkeyDev/master/bin/md-uninstall)"
更新命令
sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/AloneMonkey/MonkeyDev/master/bin/md-update)"
错误处理
安装时遇到错误
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 8 ms: Connection refused
遇到这个错误,我们去终端ping一下。
ping raw.githubusercontent.com
确定问题后,去https://www.ipaddress.com网站查询raw.githubusercontent.com对应的IP。
往下滚动查看IP地址
在终端执行open /etc命令,打开etc目录。
open /etc
将hosts复制到桌面,在hosts末尾添加185.199.108.133 raw.githubusercontent.com,然后将其拖回etc目录替换掉原来的hosts文件。
185.199.108.133 raw.githubusercontent.com
再次到终端ping raw.githubusercontent.com,发现已经没问题。
重新执行MonkeyDev安装命令,安装成功。
打开Xcode,新建应用 ,可以看到下面多了一个MonkeyDev分类。
5.使用MonkeyDev
新建项目
Xcode中选择MonkeyApp新建项目
运行项目,会遇到报错ld: file not found: /usr/lib/libstdc++.dylib。解决这个问题
重新运行,会遇到下面这个情况。解决这个问题,需要去https://github.com/facebook/fishhook下载fishhook文件替换掉项目中的文件。
运行项目成功
简单Hook一个应用
先将脱壳的包拖到TargetApp目录
更改包名和应用名称
运行安装