ios - 在 Windows 中为 PhoneGap 构建 iOS 签名 key

标签 ios iphone windows cordova phonegap-build

最近我被一些开发人员问到,当他们只有一台 Windows 机器时,他们如何使用 PhoneGapBuild (PGB) 来开发 iOS 应用程序?问题不在于开发本身,而在于提供 PGB 可用于构建 iOS 应用程序的 key 。

一个主要问题是 PGB 的常见问题解答给出了使用 mac 来实现此目的的说明,另一个问题是 Apple 的文档假定了相同的内容。

那么,是否可以在不使用 mac 的情况下在 windows 中创建 key ,如果可以,那么具体的步骤是什么?

最佳答案

我总是向人们发送 Ian Devlin 的一篇优秀文章的链接:http://www.iandevlin.com/blog/2012/11/phonegap/building-an-ios-signing-key-for-phonegap-in-windows .

解决方案的核心是使用 windows openssl 或 cygwin 变体在 windows 中执行以下操作:

openssl genrsa -des3 -out ios.key 2048

openssl req -new -key ios.key -out ios.csr -subj "/emailAddress=MY-EMAIL-ADDRESS, CN=COMPANY-NAME, C=COUNTRY-CODE"

然后,转到apple使用您刚刚生成的 csr 文件申请证书。这很简单。

生成 PEM 和 P12:

openssl x509 -in ios_development.cer -inform DER -out ios_development.pem -outform PEM

openssl pkcs12 -export -inkey ios.key -in ios_development.pem -out ios_development.p12

伊恩解释的结尾说,

The last file you need to generate is the provisioning profile, which again requires you to return to the Apple Provisioning Portal. There is plenty of documentation there on how to do this, so I won’t go into it here. Bear in mind that such certificates need to be tied to your iOS testing devices via their UDIDs, and again there is documentation on how to do this.

Once the provisioning profile is generated, download it (e.g. iOS_Development.mobileprovision) and save it in the same place as the other files. This file will also need to be installed on each of your iOS testing devices.

在配置过程中,您必须创建一个 bundle id——不要试图找到它,因为它不存在——你注定要弥补它,最简单的方法是使用通配符ID 像 com.yourcompany.*。如果您没有使用推荐的临时分发,您还需要提供 iOS 设备的 UUID。您可以免费下载一个 UUID 应用程序来为您提供此功能,或者您可以将设备插入 Windows 并在 iTunes 中查找数据(参见 this question )。如果您不喜欢 iTunes,则应用程序方法更可取(让我们面对现实吧,如果您正在阅读本文,那么您可能不喜欢)。

最后,您不需要将配置文件上传到您的 iOS 设备。您几乎可以使用任何二维码扫描仪来加载它,并且应用程序和配置文件都将被安装。

关于ios - 在 Windows 中为 PhoneGap 构建 iOS 签名 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20649189/

相关文章:

ios - 如何获得 2x 图像作为屏幕截图?

iphone - 如何在 Ipad 中播放来自 URL 的视频?

c - 为什么这个可变参数函数在 Windows x64 上的第 4 个参数上失败?

ios - 来自 NSObject 的 PresentViewController?

c# - xamarin 表单应用程序链接 - 从 ios 应用程序委托(delegate)打开 PCL View

iphone - NSURLConnection 与委托(delegate) vs initWithContentsOfURL : with Grand Central Dispatch

iphone - 取消按钮在 iPhone 短信集成中不起作用

ios - 如何传递多个参数addTarget?

c - memset用于内存分配?

windows - Composer 安装 : error on temporary file