xcode 如何使用 Phonegap 命令行工具为 iOS 发布版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19628957/
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
How to make release Build for iOS using Phonegap Command Line Tools ?
提问by Aarush
I want to make the Release Buildfor iOS platformwith the Distribution Certificate& Mobile Provisioning Profile. I want to do this using Phonegap(Cordova) Command Line Toolswhere I don't want to open XCode.
我想使用Distribution Certificate& Mobile Provisioning Profile为iOS 平台制作Release Build。我想使用我不想打开XCode 的Phonegap(Cordova) 命令行工具来做到这一点。
I have mobile provisioning profile and distribution certificate. I have also installed XCode, NodeJSon my machine but I don't want to open the Xcode only generate iOS release build using cordova command line tools.
我有移动配置文件和分发证书。我还在我的机器上安装了XCode、NodeJS但我不想打开 Xcode 只使用cordova命令行工具生成iOS发布版本。
If it is possible then please help me.
如果可能,请帮助我。
回答by Zhongyuan Zhou
cordova build ios --device --release
you should have a file called build.json in cordova. In build.json, the content should like this
您应该在cordova 中有一个名为build.json 的文件。在build.json中,内容应该是这样的
"ios": {
"debug": {
"codeSignIdentitiy": "iPhone Development",
"provisioningProfile": "*****"
},
"release": {
"codeSignIdentitiy": "iPhone Distribution",
"provisioningProfile": "******"
}
}
回答by Joel Jeske
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. The file is located here: <project-dir>/platforms/ios/cordova/build.xcconfig
在您的 cordova/phonegap 项目中,您可以写入 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. This allows for easy configuration with minimal modification to cordova.
当您cordova build ios
使用 optional--release
或运行时--device
,cordova 将指向该文件。这允许在对cordova 进行最少修改的情况下轻松配置。
回答by tuxSlayer
Just run
赶紧跑
<project_dir>/platforms/ios/cordova/build.sh --release
<project_dir>/platforms/ios/cordova/build.sh --release
This platforms/<platform>/cordova
dir contains actual build script. You can take a look at it to check out how cordova do builds.
该platforms/<platform>/cordova
目录包含实际的构建脚本。您可以查看它以了解cordova 是如何构建的。
UPD.To make device build (i.e. with arm architecture, not for i386 emulator) pass --device
parameter as well.
更新。为了使设备构建(即使用 arm 架构,不适用于 i386 模拟器)也传递--device
参数。
回答by Radu Cosoveanu
You should go on build.phonegap.com and create there an account with an email and a password. After, you login, there are steps:
您应该访问 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.