最近通過jenkins打包生成的ipa上傳到fir.im上,掃描二維碼的時候總是提示無法安裝,一直沒找到原因,在尋找的過程中發現了Log Guru這個日志分析工具,能分析具體的原因。原文鏈接在此:http://fir.im/tools/log_guru
fir這里列出了幾種常見的原因:
1.證書被封:
(Invalid signing certificate (it may have expired or been revoked))
2.手機內已安裝該應用,但是應用的證書和當前下載的證書不同:
profiled?(Note ) MC: Provisioning profiles changed
installd?0x100724000 -[MIInstallableBundle performVerificationWithError:]: 517: Upgrad? ? ? ? e's application-identifier entitlement string (證書前綴1.BundleID) does not match installed application's application-identifier string (證書前綴2.BundleID); rejecting upgrade.
解決方法:刪除舊的應用,重新安裝。
3.框架不支持:
installd?0x2fe93000 install_application: Could not preflight application installitunesstored?0x15f6000 MobileInstallationInstall: failed with -1
installd?0x2fe93000 handle_install: API failed
解決方法:在Build Settings -->Valid Architectures中添加相應的框架。
4.沒有添加 UDID:
installd?profile not valid: 0xe8008012
installd?0x385000 install_embedded_profile: Could not install embedded profile: 0xe8008012
解決方法:添加該設備的 UDID
但我自己遇到了一個不再這4個里面的問題,如下:
installd?0x16e1bb000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 142: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.LfhDXF/extracted/Payload/4dBookCity.app : 0xe8008017 (A signed resource has been added, modified, or deleted.)
開始以為是證書的問題,翻來覆去的創建證書,發現不對,經過谷歌搜索發現Product Name和Product Module Name也會影響,然后把其復原為默認設置發現也不行,最終通過git版本比較發現在Build Settings的User Defined下面多了這個,這是因為之前版本用Swift開發(發現Swift的包體積會比OC的大5MB),現在改為Objc的,但在Objc改成Swift的時候自動生成了SWIFT_OBJC_BRIDGING_HEADER這個KEY,所以在Swift改為Objc的時候需要吧這個刪除。到此終于解決!