简体   繁体   English

内部配置不起作用

[英]In-house provisioning not working

iOS App Provisioning is, as most will probably agree, among the most confusing and complicated subjects an iOS developer has to deal with and I'm one of them. 正如大多数人可能会同意的那样,iOS App Provisioning是iOS开发人员必须处理的最令人困惑和最复杂的主题之一,我就是其中之一。 :-) :-)

One of our teams needs to start beta testing their app. 我们的团队之一需要开始对其应用进行Beta测试。 It's a corporate app that will eventually be released in our company's app catalogue (InTune) for use with a few thousand colleagues. 这是一个公司应用程序,最终将在我们公司的应用程序目录(InTune)中发布,供数千名同事使用。 As far as I've seen Inhouse distribution is for this exact purpose: Deploy to a limited number of invited non-developer testers but without having to harvest their UDIDs. 据我所知,内部发行版正是出于此目的:部署到数量有限的受邀非开发人员测试人员,而不必获取其UDID。 For this purpose I have set up: 为此,我设置了:

  • An Inhouse provisioning profile, based on the exact same AppId as the team's development profile. 内部部署配置文件,基于与团队开发配置文件完全相同的AppId。
  • Set up an AppCenter beta test group and invited some colleagues as testers. 成立一个AppCenter Beta测试小组,并邀请一些同事作为测试人员。
  • Added a "publish to AppCenter" step in the project's build definition that deploys the .IPA file to the mentioned test group in AppCenter. 在项目的构建定义中添加了“发布到AppCenter”步骤,该步骤将.IPA文件部署到AppCenter中提到的测试组。

When the build runs all works fine and the app gets deployed to the test group as intended. 当构建运行时,一切正常,应用程序将按预期部署到测试组。 Each tester is allowed to install the app and all looks good. 每个测试人员都可以安装该应用程序,并且看起来都不错。 But when they try to install the app they get a very non-descriptive error message saying the "the app cannot be installed". 但是,当他们尝试安装该应用程序时,会收到一条非常简短的错误消息,提示“该应用程序无法安装”。

I have checked the device log and found an error message: "The executable was signed with invalid entitlements." 我检查了设备日志,发现错误消息:“可执行文件已使用无效的权利进行了签名。”

I have also re-created the failed deployment from Visual Studio (Mac) by downloading the Inhouse provisioning profile (+ signing certifictate) and re-target the build/deployment to "In-house". 我还通过下载内部配置文件(+签名证书)并重新将构建/部署目标定位为“内部”,从Visual Studio(Mac)重新创建了失败的部署。 For good measure I also selected the In-house profile manually. 为了获得良好的效果,我还手动选择了内部配置文件。

When I build and deploy to a simulator all works fine but when I deploy to a physical device I get this error in Visual Studio (Mac): 当我构建并部署到模拟器时,一切正常,但是当我部署到物理设备时,在Visual Studio(Mac)中出现此错误:

ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.zveLv9/extracted/{name-of-app}.app : 0xe8008016 (The executable was signed with invalid entitlements.) error MT1006: Could not install the application '{path-to-app}.app' on the device '{my-device-name}': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).

My understanding is that entitlements are enabled with the AppId and requested with the entitlemens in code (via the Entitlements.plist file). 我的理解是,使用AppId启用了权利,并通过代码中的Entitlemens请求了权利(通过Entitlements.plist文件)。 This leads med to assume that two profiles referencing the same AppId would also enabled the same Entitlements. 这使med假设引用相同AppId的两个配置文件也将启用相同的权利。 Is this incorrect? 这不正确吗? Obviously, I am requesting the same entitlements from code as I'm compiling the exact same branch using the two different provisioning profiles. 显然,我要从代码中请求相同的权利,就像我使用两个不同的供应配置文件来编译完全相同的分支一样。

I suspect I have misunderstood or overlooked something ... 我怀疑我误解或忽略了某件事...

The problem turned out to be the "Push Notifications" entitlement. 问题原来是“推送通知”权利。

The Entitlement.plist file contains an "aps-environment" setting (in Visual Studio Mac open Entitlements file and select the "Source" tab) which was set to "development". Entitlement.plist文件包含一个“ aps-environment”设置(在Visual Studio Mac中打开Entitlements文件并选择“ Source”选项卡),该设置被设置为“ development”。 When deploying a release build to a physical device this caused a mismatch with the actual entitlement of the provisioning profile. 在将发布版本部署到物理设备时,这会导致与配置文件的实际权利不匹配。

To fix this I created a second Entitlement.plist file, changed the "aps-environment" setting to "production" and saved it as "Entitlement.prod.plist" (I also renamed the original file to "Entitlement.dev.plist" for clarity). 为了解决这个问题,我创建了第二个Entitlement.plist文件,将“ aps-environment”设置更改为“ production”,并将其保存为“ Entitlement.prod.plist”(我也将原始文件重命名为“ Entitlement.dev.plist”为清楚起见)。

Finally, I just changed the Bundle settings (Debug, Release, ...) to pick the correct Entitlement file and now it works as expected. 最后,我只是更改了Bundle设置(Debug,Release,...)以选择正确的授权文件,现在它可以按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM