简体   繁体   English

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

[英]How to make release Build for iOS using Phonegap Command Line Tools ?

I want to make the Release Build for iOS platform with the Distribution Certificate & Mobile Provisioning Profile . 我想使用发行证书移动供应配置文件 制作 iOS平台发布版本 I want to do this using Phonegap(Cordova) Command Line Tools where I don't want to open XCode . 我想使用Phonegap(Cordova)命令行工具执行此操作,而我不想打开XCode

I have mobile provisioning profile and distribution certificate. 我有移动供应配置文件和分发证书。 I have also installed XCode , NodeJS on my machine but I don't want to open the Xcode only generate iOS release build using cordova command line tools. 我还在机器上安装了XCodeNodeJS ,但是我不想打开仅使用cordova命令行工具生成Xcode的iOS版本。

If it is possible then please help me. 如果有可能,请帮助我。

cordova build ios --device --release

you should have a file called build.json in cordova. 您应该在cordova中有一个名为build.json的文件。 In build.json, the content should like this 在build.json中,内容应如下所示

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

I know this is an old thread but I had the same issue and my answer might help more people. 我知道这是一个旧主题,但是我遇到了同样的问题,我的回答可能会帮助更多的人。

In your cordova/phonegap project, you can write to a build.xcconfig for all your configuration needs. 在您的cordova / phonegap项目中,您可以写入build.xcconfig来满足您的所有配置需求。 The file is located here: <project-dir>/platforms/ios/cordova/build.xcconfig 该文件位于以下位置: <project-dir>/platforms/ios/cordova/build.xcconfig

When your run cordova build ios with optional --release or --device , cordova will point to the file. 当您运行cordova build ios使用可选的--release--device cordova build ios时,cordova将指向该文件。 This allows for easy configuration with minimal modification to cordova. 这样可以轻松进行配置,而对cordova的修改最少。

Just run 赶紧跑

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

This platforms/<platform>/cordova dir contains actual build script. 这个platforms/<platform>/cordova目录包含实际的构建脚本。 You can take a look at it to check out how cordova do builds. 您可以查看它以检查cordova的构建方式。

UPD. UPD。 To make device build (ie with arm architecture, not for i386 emulator) pass --device parameter as well. 要进行设备构建(例如,使用arm体系结构,而不是i386仿真器),还要传递--device参数。

You should go on build.phonegap.com and create there an account with an email and a password. 您应该转到build.phonegap.com并在其中创建一个包含电子邮件和密码的帐户。 After, you login, there are steps: 登录后,有以下步骤:

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.

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

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