如何使用Phonegap命令行工具进行iOS版本的发布?

时间:2013-10-28 07:13:14

标签: ios xcode cordova phonegap-build

我想使用分发证书&amp ;;为 iOS平台制作发布版 移动设置配置文件。我想使用 Phonegap(Cordova)命令行工具来执行此操作,其中我不想打开 XCode

我有移动配置文件和分发证书。我还在我的机器上安装了 XCode NodeJS ,但我不想打开Xcode,只使用cordova命令行工具生成iOS版本。

如果有可能请帮助我。

4 个答案:

答案 0 :(得分:4)

cordova build ios --device --release

你应该在cordova中有一个名为build.json的文件。 在build.json中,内容应该是这样的

  "ios": {
    "debug": {
       "codeSignIdentitiy": "iPhone Development",
       "provisioningProfile": "*****"
    },
   "release": {
     "codeSignIdentitiy": "iPhone Distribution",
     "provisioningProfile": "******"
   }
 }

答案 1 :(得分:1)

我知道这是一个老线程,但我有同样的问题,我的回答可能会帮助更多人。

在cordova / phonegap项目中,您可以写入build.xcconfig以满足您的所有配置需求。该文件位于此处:<project-dir>/platforms/ios/cordova/build.xcconfig

当您使用可选cordova build ios--release投放--device时,cordova将指向该文件。这样可以轻松配置,只需对cordova进行最少的修改。

答案 2 :(得分:0)

跑步

<project_dir>/platforms/ios/cordova/build.sh --release

platforms/<platform>/cordova目录包含实际的构建脚本。您可以查看它以了解cordova的构建方式。

<强> UPD。 要使设备构建(即使用arm架构,而不是i386仿真器),也要传递--device参数。

答案 3 :(得分:-6)

您应该继续使用build.phonegap.com并在那里创建一个包含电子邮件和密码的帐户。 之后,您登录后,有以下步骤:

1. Upload a zip of your project.
2. Start building it for first time.
3. Go on account (top left user icon) -> edit settings
4. Go to on Signing keys and add a new key by uploading the p12 and provisioning files
5. Unlock it using the password of the certificate.
6. Go on apps menu, you should have the app.
7. Press on app title in order to expand the builds
9. Select the key for IOS.

After that start a cmd window, make sure you have all requirements met (as is described here:http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html).
In that cmd window, you should perform following commands:
phonegap remote login -u <the account email> -p <the password>
phonegap remote build ios


In order to be all ok, you should be sure to have in config.json file the id of this new account.
Also, in order to perform the previous phonegap commands, you need to be in the folder of the project.

Please, be aware, the activation of the ios key is around 1 hour. If you want to do this automatically, you should first login, unlock the key, and build.
相关问题