真机上运行.framework时,如果报
dyld'dyld_fatal_error:
dyld: Library not loaded: @rpath/XX.framework/XX
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/DF33E1CB-0A69-4303-A22A-686E643DE922/iDoctors.app/XX.framework/XX: code signing blocked mmap() of '/private/var/containers/Bundle/Application/DF33E1CB-0A69-4303-A22A-686E643DE922/iDoctors.app/XX.framework/XX'
Message from debugger: Terminated due to signal 6
信息时表示framework动态库没有签名,需要进行重签名
1.查看framework的签名证书
命令:codesign -d -vv XX.framework
结果:
Identifier=。。。。。
Format=bundle with Mach-O universal (i386 armv7 x86_64 arm64)
CodeDirectory v=20200 size=1553 flags=0x0(none) hashes=43+3 location=embedded
Signature size=4704
Authority=iPhone Developer: 。。。。。
(V29747P8JD)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=。。。。。
Info.plist entries=21
TeamIdentifier=。。。。。
Sealed Resources version=2 rules=12 files=17
Internal requirements count=1 size=184
2.删除原有的签名
进入到XX.framwork文件夹内,删除_CodeSignature文件夹
3.查看本机可用的签名文件
命令:/usr/bin/security find-identity -v -p codesigning
结果:
1) EE09C867380905FAC14709270E24115220F916CD "iPhone Developer: 。。。。。。 (。。。。。。
)"
2) BBB914894BEA70D9817F08637BDB783482AB996E "Mac Developer: 。。。。。。
(。。。。。。
)"
3) C2E7EEE17EDDFBCAB216325BDB9AC13A155424B5 "iPhone Developer: 。。。。。。
(。。。。。。
)"
4) 9BFAF7DE5562E30D59ACEA416E7AC08E3059464B "iPhone Developer: 。。。。。。
(。。。。。。
)"
4 valid identities found
4.使用签名文件签名
命令:codesign -fs “iPhone Developer: xxxx (XXXX)” XX.framework