![](/img/trans.png)
[英]No place to specify iOS Bundle Signing and Provisioning in Visual Studio 2022 and MAUI
[英]Visual Studio does not apply provisioning profile to MAUI iOS app in Debug mode
我有一個 Xamarin Forms 應用程序,我升級到 .NET MAUI。 Visual Studio 識別供應配置文件(如果我打開下拉列表,我可以看到兩個有效的,一個通配符和一個特定的 - 我已經嘗試手動 select 在這里正確的一個,但無濟於事):
構建 output 表示它也被識別:
Target _DetectSigningIdentity:
Detected signing identity:
Code Signing Key: "Apple Development: Gerwin de Groot (<some id>)" (<some other id>)
Provisioning Profile: "Example (Debug)" (<some id>)
Bundle Id: com.example.test
App Id: <team id>.com.example.test
但部署到設備失敗:
CopyingFile - Path: /Users/gerwin/Public/Projects/Example/bin/Debug/net6.0-ios/ios-arm64/Example.app/Poppins-MediumItalic.ttf
CopyingFile - PercentComplete: 99%
CreatingStagingDirectory - PercentComplete: 5%
ExtractingPackage - PercentComplete: 15%
InspectingPackage - PercentComplete: 20%
PreflightingApplication - PercentComplete: 30%
VerifyingApplication - PercentComplete: 40%
ApplicationVerificationFailed: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.0vKSvJ/extracted/Example.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)
error MT1006: Could not install the application '/Users/gerwin/Public/Projects/Example/bin/Debug/net6.0-ios/ios-arm64/Example.app' on the device 'Gerwin's iPhone 11': AMDeviceSecureInstallApplicationBundle returned: 0xe8008015.
Application could not be uploaded to the device.
它在 iPhone 上可見,但有一個空白的應用程序圖標和一個雲指示器:
點擊它會給出錯誤信息
無法安裝“示例”
無法安裝此應用程序,因為無法驗證其完整性。
如果我嘗試使用命令行,我會得到類似的結果,例如
dotnet build Example.csproj -c Debug -f net6.0-ios -t:Run -p:_DeviceName=<device UDID>
盡管令人驚訝,發布模式( -c Release
而不是-c Debug
)有效(從命令行,而不是從 Visual Studio 本身,因為另一個錯誤)。
我怎樣才能解決這個問題?
這會很長
首先,我必須輸入我的 IOS 帳戶,作為團隊的一員,具有管理員權限(不確定是否可以使用更低的權限)。
這是在工具 > 設置 > xamarin > AppleAccounts 中完成的。 如果您在彈出窗口出現時不這樣做。
在項目屬性中,我必須 select 自動配置並按照步驟操作。
理論上應該有:
但是,它在第 2 步失敗了。所以我不得不將 go 發送到: https://developer.apple.com/account/resources/identifiers/list
並自己添加標識符。 如果您的應用程序是 com.mycompany.myapp,請將其創建為:com.mycompany.*。
之后,我回到項目屬性,再次嘗試自動配置。
它檢測到步驟 1 和 2 已完成,添加了設備,添加了配置文件,成功簽名並部署了它。
(請記住,使用熱重載進行調試不會處理應用程序圖標、啟動畫面等……所以當您發現它們丟失時不要感到驚訝。)
時不時地我必須再次執行此過程,因為當我更新 VS 或 .NET 版本時,會發生無法解釋的問題。
祝你好運。
似乎您的 iOS 設備不受信任。
有幾種方法可以配置 iOS 設備,
手動配置 iOS 個應用程序。 生成新的配置文件時,請記住還包括要部署的設備。 實際上我更喜歡使用這種方式,因為它對我來說更清楚。
您可以查看上面的文檔並嘗試一下。
希望對你有效。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.