1. 程式人生 > >webrtc 編譯完成,安裝時錯誤

webrtc 編譯完成,安裝時錯誤

歷盡千辛萬苦,webrtc編譯完成。如果能能走到這一步,那麼恭喜你,你已經打敗99%的人了。最後就是安裝到真機上面測試,還有最後一個問題需要解決。

執行安裝命令

ideviceinstaller -i out_ios/Debug-iphoneos/AppRTCDemo.app

發生錯誤:

Install failed. 
Failed to verify code signature

錯誤日誌

ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008016: Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.Ufd0uM/extracted/AppRTCDemo.app identifier = com.google.AppRTCDemo type = 4> : 0xe8008016 (Entitlements found that are not permitted by provisioning profile)

這是由於bundleid和簽名不一致引起的,如何修改過簽名證書,一般回發生這個錯誤
webrtc 預設的bundleid 為

 com.google.AppRTCDemo

存在這個檔案裡:

 ./examples/objc/AppRTCDemo/ios/Info.plist

將下面這兩行裡的com.google.AppRTCDemo改為合適的bundleid

<key>CFBundleIdentifier</key>
  <string>com.google.AppRTCDemo</string>

重新執行指令碼生成編譯工程:

 webrtc/build/gyp_webrtc

再執行編譯 :

ninja -C out_ios/Debug-iphoneos AppRTCDemo

成功編譯後執行以下命令安裝app:

 ideviceinstaller -i out_ios/Debug-iphoneos/AppRTCDemo.app

若能成功輸出:

Uploading AppRTCDemo.app package contents... DONE.
Installing '(null)'
Install: CreatingStagingDirectory (5%)
Install: ExtractingPackage (15%)
Install: InspectingPackage (20%)
Install: TakingInstallLock (20%)
Install: PreflightingApplication (30%)
Install: InstallingEmbeddedProfile (30%)
Install: VerifyingApplication (40%)
Install: CreatingContainer (50%)
Install: InstallingApplication (60%)
Install: PostflightingApplication (70%)
Install: SandboxingApplication (80%)
Install: GeneratingApplicationMap (90%)
Install: Complete

到這裡大功告成。
下一節解決Xcode工程問題。