關(guān)于
optool網(wǎng)上的資源還可以,我認(rèn)為這個(gè)mac下編譯optool方法寫(xiě)的就很不錯(cuò), 我會(huì)附帶圖片說(shuō)明
- 安裝
- 從Git上克隆一下, 此時(shí)的
optool還不完整
git clone https://github.com/alexzielenski/optool.git
- 進(jìn)行安裝,嘗試一下會(huì)不會(huì)出錯(cuò),如果出錯(cuò)肯定是
optool不完整
cd optool/
git submodule update --init --recursive
- 出錯(cuò)了的話, 就去看看
FSArgumentParser/CoreParse這兩個(gè)文件夾有沒(méi)有東西, 少了什么就去添加什么, FSArgumentParser, CoreParse, 也就是CoreParse放ArgumentParser里,ArgumentParser放optool/FSArgumentParser里 - 弄完第三步,再去執(zhí)行第二步
- 此時(shí)回到帶有
.git的最外面的根目錄下執(zhí)行
xcodebuild -project optool.xcodeproj -configuration Release ARCHS="x86_64" build
- 如果遇到以下錯(cuò)誤, 到工程中修改
Build Settings的版本信息選擇Latest macos最新的版本
Check dependencies error: There is no SDK with the name or path ‘/Users/mopsled/Source/optool/macosx10.9’

第六步
在使用
optool的時(shí)候舉個(gè)例子:
$ /path/to/optool install -c load -p "@executable_path/WeChatRedEnvelop.dylib" -t wechat/Payload/WeChat.app/WeChat
類(lèi)似這么個(gè)使用方式,其中的/path/to/optool這個(gè)東西是你的optool工程運(yùn)行之后的產(chǎn)物。。。所在的地址

運(yùn)行工程

show in finder 就是這個(gè)所在的地址
ps: 也許會(huì)遇到 Submodule path 'optool/FSArgumentParser/CoreParse': checked out '1be510abdfffb33544272cd2ce82d4b0b3260723'這么個(gè)問(wèn)題, 我也不知道怎么過(guò)去的, 這個(gè)問(wèn)題就是多試幾次 git submodule update --init --recursive這個(gè)就會(huì)好

我的整個(gè)過(guò)程截圖