ios iOS8 扩展需要自己的配置文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25329510/
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-08-31 01:51:05  来源:igfitidea点击:

iOS8 extension needs own provisioning profile?

iosxcodeprovisioning-profileios-app-extensionbundle-identifier

提问by Neil Coxhead

I am starting an iOS 8 extension but I can't run it on my device. The error when trying to run it is:

我正在启动 iOS 8 扩展程序,但无法在我的设备上运行它。尝试运行时的错误是:

No matching provisioning profiles found

未找到匹配的配置文件

The provisioning profile specified in your build settings (“ExtensionName”) has an AppID of net.company.AppNamewhich does not match your bundle identifier net.company.AppName.ExtensionName. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.

在您的构建设置(“ExtensionName”)中指定的配置文件的 AppIDnet.company.AppName与您的包标识符不匹配net.company.AppName.ExtensionName。Xcode 可以通过从会员中心下载新的配置文件来解决此问题。

  1. Do I need a separate provisioning profile for both the main app and the extension ?
  2. Should they share a bundle identifier (by default it adds the extension name to the bundle identifier, so perhaps not) ?
  3. If it has a separate bundle identifier how is that reflected in the provisioning profile (if there is a separate one) ?
  1. 我是否需要为主应用程序和扩展程序提供单独的配置文件?
  2. 他们是否应该共享一个包标识符(默认情况下,它会将扩展名添加到包标识符中,所以可能不是)?
  3. 如果它有一个单独的包标识符,它是如何反映在配置文件中的(如果有一个单独的)?

采纳答案by Oxcug

It would seem that Xcode would prefer it that way, however there's nothing stopping you from using a wildcard profile until you want to do an Adhoc or Release to the App Store. More to the point of your question though, for every target that you have, you need a profile and bundle ID. So yes, you "need" another provisioning profile for your Extension, although I expect Apple to streamline this process.

Xcode 似乎更喜欢这种方式,但是在您想要对 App Store 进行临时或发布之前,没有什么能阻止您使用通配符配置文件。更重要的是,对于您拥有的每个目标,您都需要一个配置文件和包 ID。所以是的,您“需要”另一个扩展程序配置文件,尽管我希望 Apple 能够简化此过程。

All in all, it's probably best to just use a WildCard dev profile until you need a provisioning profile. Remember this is all a beta, and they're still working on pretty much everything.

总而言之,最好只使用 WildCard 开发配置文件,直到您需要配置配置文件。请记住,这只是一个测试版,他们仍在处理几乎所有事情。

回答by Daniel Storm

I've located this documentation pertaining to App Extensions. If you read the bottom of page 20 if seems that using the same distribution certificate is actually suggested. I've gone ahead and changed my bundle identifier for the Today Extension to extend my applications. For example, com.DeveloperName.AppName.TodayExtension, created an App ID in the Dev Centerto correspond with that, and created a distribution profile for it. My app +Quoteshas successfully been updated by following these steps. I have not experienced any issues with the app or extension, but Xcode does seem to get a little confused when trying to auto assign the correct provisioning profiles for my extension now. Selecting them manually solves this.

我找到了有关App Extensions 的文档。如果您阅读第 20 页的底部,似乎实际上建议使用相同的分发证书。我已经更改了 Today Extension 的包标识符以扩展我的应用程序。例如,com.DeveloperName.AppName.TodayExtensionDev Center 中创建了一个 App ID与之对应,并为其创建了一个分发配置文件。我的应用+Quotes已通过以下步骤成功更新。我的应用程序或扩展程序没有遇到任何问题,但是当现在尝试为我的扩展程序自动分配正确的配置文件时,Xcode 似乎有点困惑。手动选择它们可以解决这个问题。

回答by honcheng

Extensions are separate targets from the host app. You have to treat them as though they are separate apps with different bundle identifiers and different provisioning profiles.

扩展是与宿主应用程序不同的目标。您必须将它们视为具有不同捆绑标识符和不同配置文件的独立应用程序。

It's best if you just create them during testing instead of using wildcards because you may need to test some capabilities that you enabled, for example App Group so that your extension and host app can access the same container.

最好在测试期间创建它们而不是使用通配符,因为您可能需要测试您启用的某些功能,例如应用程序组,以便您的扩展和主机应用程序可以访问同一个容器。

Note that if you want to have any capabilities enabled for your host app and extensions, you have to enable them individually for all of them.

请注意,如果您想为您的主机应用程序和扩展程序启用任何功能,您必须为所有这些功能单独启用它们。

回答by Vaibhav Saran

You do need a separate provisioning profile for you extension but with the same certificate your main app has. When you are creating a new provisioning profile, your Extension's app id will also appear in the list, choose that, and proceed to create a new provisioning profile.

您确实需要为您的扩展程序提供单独的配置文件,但与您的主应用程序具有相同的证书。当您创建新的配置文件时,您的扩展程序的应用程序 ID 也将出现在列表中,选择该 ID,然后继续创建新的配置文件。

Also choose that provisioning profile in the target of your extension.

还要在您的扩展目标中选择该配置文件。

enter image description here

在此处输入图片说明

回答by nr5

I simply use "Automatically manage sign in" until I need to push to App store. This works out of the box with simulators, haven't tried with devices yet.

我只是使用“自动管理登录”,直到我需要推送到 App Store。这在模拟器上开箱即用,尚未在设备上尝试过。

Few pointers for Appstore Build:

Appstore Build 的几个要点:

  1. I created one wildcard id for every notification extension, but the prefix of this wildcard bundle id should match your app's bundle id as prefixed. If it's not like this, this error will come up: "Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier". So, if your app's bundle-id is: "com.companyName.appName", the wildcard bundle-id for your extension should be "com.companyName.appName.*". You can then replace * with a specific notification extension in the XCode. Note apple only allows one period(".") after the app's bundle id for naming your extension's bundle id.
  2. The version and build number of your extension should match that of your app.
  3. Once App Id is created, create a distribution provisioning profile with this and use it in XCode.
  1. 我为每个通知扩展创建了一个通配符 id,但是这个通配符包 ID 的前缀应该与你的应用的包 ID 匹配作为前缀。如果不是这样,则会出现此错误:“嵌入式二进制文件的包标识符未以父应用程序的包标识符为前缀”。因此,如果您的应用程序的 bundle-id 是:"com.companyName.appName",则扩展程序的通配符 bundle-id 应该是"com.companyName.appName.*"。然后,您可以将 * 替换为 XCode 中的特定通知扩展。请注意,Apple 只允许在应用程序包 ID 之后使用一个句点(“.”)来命名扩展程序的包 ID。
  2. 您的扩展程序的版本和内部版本号应与您的应用程序的版本和内部版本号相匹配。
  3. 创建 App Id 后,使用此创建分发配置文件并在 XCode 中使用它。