注入dylib后闪退

Mar 10 19:33:55 iPhone-9 ReportCrash[7205] : Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000012001d088
Triggered by Thread: 0
Mar 10 19:33:55 iPhone-9 ReportCrash[7205] : Dyld Error Message:
Dyld Message: Library not loaded: @executable_path/hook.dylib
Referenced from: /var/mobile/Containers/Bundle/Application/3A9F3888-F022-48C6-9D8D-8BC64EA39BFC/iMail.app/iMail
Reason: no suitable image found. Did find:
/var/mobile/Containers/Bundle/Application/3A9F3888-F022-48C6-9D8D-8BC64EA39BFC/iMail.app/hook.dylib: no matching architecture in universal wrapper
/private/var/mobile/Containers/Bundle/Application/3A9F3888-F022-48C6-9D8D-8BC64EA39BFC/iMail.app/hook.dylib: no matching architecture in universal wrapper

日志如上

架构不对。你otool看下架构

ok 最近有新需求 用户上传他们的应用和证书 我们后台脚本自动注入我们的动态库实现一些功能 以前没做过这方面的工作 完全是小白啊

写个脚本,使用optool注入二进制,然后用证书重签名打包,不就行了

没看懂。。。库你不是已经编译好待用?想实时生成?