近日,在帮朋友的电脑配置真机调试证书的时候遇到如下问题。
朋友他自己并没有购买付费版的个人开发者账号,而是找他另一个购买了付费版个人开发者账号的朋友帮忙生成的真机调试证书,期间我朋友仅仅是提供了一下自己的UDID,并得到了2个文件,一个是.p12文件一个是.mobileprovision文件。
按照以往经验,首先双击打开.p12文件,再打开.mobileprovision,通常此时已经可以进行真机调试,可是经过实践发现,只有一部分项目可以进行真机调试,另一部分项目则在运行后报告各种从未遇见的各种错误,如:
dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/HMWeibo06 Reason: no suitable image found. Did find: /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire: mmap() error 1 at address=0x10020C000, size=0x00048000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire: mmap() error 1 at address=0x1002F4000, size=0x00048000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire: mmap() error 1 at address=0x1003E0000, size=0x00048000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/91F9AFEB-5DC2-473D-BACD-BE003493633E/HMWeibo06.app/Frameworks/Alamofire.framework/Alamofire (lldb)
反复调整项目配置信息无果。但是,在检查证书状态的时候发现真机调试证书被系统标示为:此证书是由未知授权机构签名的。
经检索互联网发现,原来是WWDR Intermediate Certificate没有导入,从苹果官网下载并导入后即可正常调试。
此时,原调试证书的状态也将变为:此证书有效。
至此,问题解决。