简体   繁体   English

如何获取.mobileprovision在Windows上构建phonegap iPhone应用程序?

[英]how to get .mobileprovision to build phonegap iphone app at windows?

I'm using windows 8 to building applications with phonegap, every thing is good except building apple application at: https://build.phonegap.com 我正在使用Windows 8通过phonegap构建应用程序,除了在以下位置构建Apple应用程序外,其他所有事情都很好: https ://build.phonegap.com

this appears: phonegap build "no key selected" 出现:phonegap构建“未选择密钥”

how to get the key or .mobileprovision file? 如何获取密钥或.mobileprovision文件? 在此处输入图片说明

You have to create them on https://developer.apple.com/ , as AJD mentioned. 如AJD所述,您必须在https://developer.apple.com/上创建它们。

  • Go to your Apple developer portal 转到您的Apple开发人员门户
  • Click Devices to register your iOS device. 单击设备以注册您的iOS设备。 You need to connect your device to iTunes to obtain your UUID 您需要将设备连接到iTunes以获得UUID
  • Click Certificate 点击证书
  • Create a certificate for Production (to use PhoneGap Build, otherwise Development) 创建生产证书(使用PhoneGap Build,否则使用Development)
  • Download the certificate 下载证书
  • Convert the certificate to a p12 file (See the screenshots below) - Double-click the .cer file to open it in Key Chain Access. 将证书转换为p12文件(请参见下面的屏幕截图)-双击.cer文件以在“密钥链访问”中将其打开。 Then click My Certificates under the category, Ctrl-click the certificate and export. 然后单击类别下的我的证书,按住Ctrl键单击该证书并导出。 When you save the .p12 file, you are asked to create a password that you will need later. 保存.p12文件时,系统会要求您创建一个稍后需要的密码。
  • Create a provision file on Apple developer portal, then download. 在Apple开发人员门户上创建配置文件,然后下载。 Again, to make this work on PhoneGap Build, you need one for Distribution, otherwise Development. 同样,要使此功能在PhoneGap Build上运行,您需要一个用于分发,否则需要开发。

Actually, I blogged about it because using PhoneGap Build is not as easy as it should to develop iOS apps. 实际上,我之所以写博客是因为使用PhoneGap Build并不像开发iOS应用程序那样容易。 http://www.pubnub.com/blog/converting-your-javascript-app-to-an-ios-app-w-phonegap/ http://www.pubnub.com/blog/converting-your-javascript-app-to-an-ios-app-w-phonegap/

I know this question is made a year ago, but I hope this helps to everybody who has the same question. 我知道这个问题是一年前提出的,但是我希望这对每个有相同问题的人都有帮助。

You create and download the provisioning profile and an associated certificate on the Apple developer site. 您可以在Apple开发人员站点上创建并下载配置文件和相关的证书。

Go https://developer.apple.com/ 前往https://developer.apple.com/

Go member center > manage certificates and profiles... 前往会员中心>管理证书和个人资料...

A valid provisioning profile is connected to a valid distribution certificate. 有效的配置文件已连接到有效的分发证书。 You will need both active. 您将需要同时激活。

Building for iOS 为iOS构建

We're now able to offer support for building to iOS devices through Adobe® PhoneGap™ Build. 现在,我们可以通过Adobe®PhoneGap™Build提供对构建iOS设备的支持。 The process for completing iOS builds is slightly different than that for other platforms: all iOS builds need to be signed by a developer certificate and a provisioning profile, that is tied to your Apple developer account and the device you wish to test on. 完成iOS构建的过程与在其他平台上完成的过程略有不同:所有iOS构建都需要由开发人员证书和配置文件签名,该证书与您的Apple开发人员帐户和要测试的设备相关联。 This document covers how to set this up. 本文档介绍了如何进行设置。

Note: Since PhoneGap Build uses Apple's standard development process to build applications, you will need to sign up for their developer program to build iOS applications on PhoneGap Build. 注意:由于PhoneGap Build使用Apple的标准开发流程来构建应用程序,因此您需要注册其开发人员程序才能在PhoneGap Build上构建iOS应用程序。 You will also need a Mac to configure your certificate and provisioning profile. 您还需要一台Mac来配置证书和配置文件。

When you upload a new application to PhoneGap Build, if you don't have a default certificate-profile pair attached to your account, you will be alerted that the iOS build can not be completed: 当您将新的应用程序上载到PhoneGap Build时,如果您的帐户没有附加默认的证书配置文件对,则会提示您iOS生成无法完成:

iOS Key Required 需要iOS密钥

Your key will actually consist of two files: a certificate and a provisioning profile. 您的密钥实际上将包含两个文件:一个证书和一个配置文件。 Apple has extensive documentation for setting up your environment locally: the best approach is to ensure you can build an iOS application to your iOS device locally, to be sure that both your certificate and your provisioning profile are set up correctly for code signing. Apple具有用于在本地设置环境的大量文档:最好的方法是确保可以在本地将iOS应用程序构建到iOS设备,以确保正确设置了证书和供应配置文件以进行代码签名。

Once you have these set up, you can export them for upload to PhoneGap Build. 设置完这些后,可以将它们导出以上传到PhoneGap Build。 For the provisioning profile, you will need a file with the mobileprovision extension, which looks like this: 对于配置文件,您将需要一个带有mobileprovision扩展名的文件,如下所示:

Provisioning Profile in Finder Finder中的配置文件

Ensure that this provisioning profile is correctly paired with the device(s) you wish to test on. 确保此配置文件已与要测试的设备正确配对。

Note that when you create your profile, you will specify the App IDs that are linked to the profile. 请注意,在创建个人资料时,您将指定链接到该个人资料的应用ID。 This is important when using PhoneGap Build: the package name you specify for your app, in your config.xml (the id attribute of the widget element) or through the Edit App page, will have to match the ID for the provisioning profile. 使用PhoneGap Build时,这一点很重要:您在config.xml(小部件元素的id属性)中或通过“编辑应用程序”页面中为应用程序指定的程序包名称必须与供应配置文件的ID匹配。 If they fail to match, your app will not be built correctly. 如果它们不匹配,则将无法正确构建您的应用。

Apple appends a "Bundle Seed ID," or "App ID Prefix," to the provisioning profile when you generate it through the iOS Developer Center. 当您通过iOS开发人员中心生成配置文件时,Apple会将“捆绑种子ID”或“应用ID前缀”附加到配置文件中。 Note that you do not to include this App ID Prefix in your config.xml for PhoneGap Build to build successfully. 请注意,请勿在config.xml中包含此App ID前缀,以使PhoneGap Build成功构建。 You just need the reverse-domain style Bundle Identifier - com.domainname.appname. 您只需要反向域样式的捆绑标识符-com.domainname.appname。 This will also be best compatible with building for other platforms. 这也将与其他平台的构建最佳兼容。

To prepare your certificate, you will need to open the Keychain Access utility on your Mac, and identify the certificate that you use for iOS development. 要准备证书,您将需要在Mac上打开“钥匙串访问”实用程序,并标识用于iOS开发的证书。 Right click on that certificate and select Export ... 右键单击该证书,然后选择“导出...”。

Export from Keychain Access 从钥匙串访问导出

Save the certificate in a location you can remember, and enter a password. 将证书保存在您可以记住的位置,然后输入密码。 Remember the password: you will need to give it to PhoneGap Build, otherwise we cannot use your certificate. 记住密码:您需要将其提供给PhoneGap Build,否则我们将无法使用您的证书。

Enter Certificate Password 输入证书密码

Now back to the website. 现在回到网站。 On the app detail page, simply select the "new key..." option from the signing key dropdown for the app in question, and then, from the list of platforms with signing available, hit add a key for iOS. 在应用程序详细信息页面上,只需从相关应用程序的签名密钥下拉列表中选择“新密钥...”选项,然后从具有可用签名的平台列表中,为iOS添加一个密钥。 Fill out the form: add your p12 certificate file and your mobileprovision file, and enter the password associated with your certificate. 填写表格:添加p12证书文件和mobileprovision文件,然后输入与证书关联的密码。

Add Certificate to PhoneGap Build 将证书添加到PhoneGap构建

Once your key is added, we'll attempt to rebuild the application for iOS. 添加密钥后,我们将尝试重建适用于iOS的应用程序。 If all goes well, you should see a link for the built ipa file available. 如果一切顺利,您应该会看到内置的ipa文件的链接。

You can then download the ipa file and use iTunes to install it directly on your provisioned iOS device. 然后,您可以下载ipa文件,并使用iTunes将其直接安装在预配置的iOS设备上。

Happy building! 建设愉快!

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

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