iOS framework动态库重签名
2017-05-15 本文已影响1461人
nenhall
真机上运行.framework时,如果报如下信息时表示framework动态库没有签名,需要进行重签名:
dyld'dyld_fatal_error:
dyld: Library not loaded: @rpath/xxxxx.framework/xxxxx
Referenced from: /var/containers/Bundle/Application/DF33E1CB-0A69-4303-A22A-686E643DE922/iDoctors.app/iDoctors
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/DF65E1CB-0A69-4303-A22A-686E643DE922/iDoctors.app/xxxxx.framework/xxxxx: code signing blocked mmap() of '/private/var/containers/Bundle/Application/DF65E1CB-0A69-4303-A22A-686E643DE922/iDoctors.app/xxxxx.framework/xxxxx'
Message from debugger: Terminated due to signal 6
<br />
相关签名命令:
1.查看framework的签名证书命令:
codesign -d -vv xxxxx.framework
<br />
2.删除原有的签名
进入到XX.framwork文件夹内,删除_CodeSignature文件夹
<br />
3.查看本机可用的签名文件,命令:
/usr/bin/security find-identity -v -p codesigning
结果示例(如果你的电脑上有更多签名文件,则会打印出更多):
1) DE340162A51981A466FA5D68BCAF2A07220BF4B2 "iPhone Developer: ... (...)"
2) 5872B661A62607BD2C892C05F3553907BEA44F4F "Mac Developer: ... (...)"
3) 39E6F6BAC63352FF3791E166A80969F088C2BF29 "iPhone Developer: ... (...)"
......
<br />
4.使用签名文件签名命令:
codesign -fs "iPhone Developer: ... (...)" xxxxx.framework