xcode 为什么我可以直接在我的设备上安装应用商店发行版?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21019760/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:31:59  来源:igfitidea点击:

How come I can install an app store distribution build directly on my device?

iosxcodeapp-storeprovisioning-profilead-hoc-distribution

提问by hverlind

I was under the impression that it was impossible to install an app store distribution build directly on a test device (without going through the actual App Store). I found multiple references to the following note by Apple (though I could not find the note itself in the current version of the iOS App Distribution Guide):

我的印象是,不可能直接在测试设备上安装应用商店发行版(而不通过实际的 App Store)。我发现 Apple 对以下注释的多次引用(尽管我在当前版本的 iOS 应用分发指南中找不到该注释本身):

"App Store provisioning profiles do not allow for a distribution built application to be installed on an Apple device. To install your distribution ready application on a device, you must create an Ad Hoc provisioning profile."

“App Store 配置文件不允许在 Apple 设备上安装分发构建的应用程序。要在设备上安装分发就绪应用程序,您必须创建一个 Ad Hoc 配置文件。”

Now consider the following: I have an Ad Hoc Distribution provisioning profile and an App Store Distribution provisioning profile. The ad hoc profile contains a list of provisioned devices, the app store profile doesn't. My (no jailbrake) device is included in the provisioned devices in the ad hoc profile. My build was signed with the app store profile. The resulting .ipa file was submitted to the App Store(and approved - but it is not publicly available yet). When I view the package contents of the .ipa file, I see that the embedded.mobileprovision is indeed the app store profile (without the provisioned devices list). When I drag this profile to my Xcode Organizer, I get an error that the profile cannot be installed because the device is not included in the profile (as expected). However, when I drag the .ipa file to my Xcode Organizer, the app installs on the device(and can be opened on the device afterwards). I tried this after making sure there were no other copies of the same app installed on the device. The same thing does not work when I use a different device that is not included in the provisioned devices of the ad hoc profile (even though the .ipa contains the app store profile without provisioned devices list).

现在考虑以下事项:我有一个 Ad Hoc Distribution 配置文件和一个 App Store Distribution 配置文件。临时配置文件包含已配置设备的列表,应用商店配置文件不包含。我的(无越狱)设备包含在临时配置文件中的配置设备中。我的构建是使用应用商店配置文件签名的。生成的 .ipa 文件已提交到 App Store(并获得批准 - 但尚未公开发布)。当我查看 .ipa 文件的包内容时,我看到 Embedded.mobileprovision 确实是应用商店配置文件(没有配置的设备列表)。当我将此配置文件拖到我的 Xcode Organizer 时,出现无法安装配置文件的错误,因为该设备未包含在配置文件中(如预期)。但是,当我将 .ipa 文件拖到我的 Xcode Organizer 时,该应用程序会安装在设备上(之后可以在设备上打开)。在确保设备上没有安装相同应用程序的其他副本后,我尝试了此操作。当我使用不包含在 ad hoc 配置文件的预配设备中的不同设备时,同样的事情不起作用(即使 .ipa 包含没有预配设备列表的应用商店配置文件)。

Does anyone have a possible explanation for this? It seems that somehow a build signed with an app store profile can still be installed on a device included in the corresponding (same app identifier? same team identifier?) ad hoc profile. But if this would be the case, what is the point of making separate ad hoc builds?

有没有人对此有可能的解释?似乎以某种方式使用应用商店配置文件签名的构建仍然可以安装在包含在相应(相同的应用程序标识符?相同的团队标识符?)临时配置文件中的设备上。但如果是这种情况,那么进行单独的临时构建有什么意义呢?

采纳答案by Rhythmic Fistman

I noticed this too and always meant to find out why it worked. It usedto be true that you couldn't install an App Store build but that appears to have changed, I'm guessing either in iOS6 or 5.

我也注意到了这一点,并且一直想找出它为什么起作用。它使用是真实的,你不能安装的App Store构建但似乎已经改变了,我在iOS6的或5猜测要么。

I found that I could only install App Store provisioning profile builds when a compatible Ad Hoc profile was already installed. Developer profiles did not work. I did not try wildcard profiles. So it looks like the Ad Hoc rules changed.

我发现我只能在已经安装了兼容的 Ad Hoc 配置文件的情况下安装 App Store 配置文件版本。开发人员配置文件不起作用。我没有尝试通配符配置文件。所以看起来 Ad Hoc 规则发生了变化。

I can't find the rules for installing an Ad Hoc build, but on the topic of launchingthe “Ad Hoc Provisioning Profiles in Depth” section of Apple's App Distribution Guidesays that

我找不到安装 Ad Hoc 构建的规则,但是关于启动Apple 的 App Distribution Guide的“Ad Hoc Provisioning Profiles in Depth”部分的主题说

The app successfully launches if the app's bundle ID matches the App ID, the signature matches the distribution certificate, and the device is in the device list of thead hoc provisioning profile.

如果应用程序的包 ID 与应用程序 ID 匹配,签名与分发证书匹配,并且设备在临时配置文件的设备列表中则应用程序成功启动。

So I guess technically an AppStore builds meet these Ad Hoc requirements because it too is signed with the same distribution certificate. The use of “the” is misleading here because it makes it sound like iOS consults your embedded.mobileprovision, which is untrue. It should read “an” ad hoc profile.

所以我猜从技术上讲,AppStore 构建满足这些 Ad Hoc 要求,因为它也使用相同的分发证书签名。“the”的使用在这里具有误导性,因为它听起来像是 iOS 咨询了您的embedded.mobileprovision,这是不真实的。它应该读作“一个”临时配置文件。

NB: The install only worked when the Ad Hoc profile was already installed on the device, so that's one reason to make separate ad hoc builds.

注意:只有当设备上已经安装了 Ad Hoc 配置文件时,安装才有效,所以这是制作单独的 ad hoc 构建的原因之一。

NB: This is all conjecture, another explanation could be that Xcode handles the installation of the embedded.mobileprovisionand now continues when the AppStore profile installation fails.

注意:这都是猜想,另一种解释可能是 Xcode 处理了 的安装,embedded.mobileprovision现在在 AppStore 配置文件安装失败时继续。

This raises another question for me: why does iOS DWIM for App Store builds yet refuses to launch Ad Hoc builds with expired provisioning profiles when a perfectly valid replacement is installed?

这对我提出了另一个问题:为什么当安装了完全有效的替代品时,iOS DWIM for App Store 版本却拒绝启动带有过期配置文件的 Ad Hoc 版本?