无法为Cordova iOS应用程序生成发布版本 [英] Can't generate release build for Cordova iOS App

查看:563
本文介绍了无法为Cordova iOS应用程序生成发布版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用 Phonegap CLI 3.1 XCode5 。我想通过命令行生成iPhone应用程序的版本构建,我有有效的分发证书移动设置配置文件。我想生成发布版本完全通过命令,不想使用XCode GUI或Phonegap Build。我试过太多的xcodebuild,xcrun甚至corodva构建命令,但没有一个提供我的发行版构建文件(以.app格式或.ipa)。

I am using Phonegap CLI 3.1 and XCode5. I want to generate the release build for iPhone Application through command line, I have valid distribution certificate and mobile provisioning profile. I want to generate the release build totally through command and don't want to use XCode GUI or Phonegap Build. I have tried too much with xcodebuild, xcrun and even corodva build command but none of them provide me the release build file (either in .app format or .ipa).

方法1(使用xcodebuild)

a) xcodebuild -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release

* BUILD FAILED **

以下构建命令失败:

** BUILD FAILED **
The following build commands failed:

CompileC build / MyApp.build / Release-iphoneos / MyApp.build / normal / armv7 / AppDelegate.o MyApp / Classes / AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build / MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MainViewController.o MyApp / Classes / MainViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MainViewController.o MyApp/Classes/MainViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler

CompileC build / MyApp.build / Release-iphoneos / MyApp.build / Objects-normal / armv7s / AppDelegate.o MyApp / Classes / AppDelegate.m normal armv7s objective-c com.apple .compilers.llvm.clang.1_0.compiler

(3次失败)



方法2(使用corodova build and xcrun to sign the app)

CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7s/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)


Method 2 (Use corodova build and xcrun to sign the app)

a) cordova build ios -release



< -release平台ios编译成功。

Compiling app on platform "ios" via command "/Users/Macuser/Desktop/MyApp/platforms/ios/cordova/build" --release Platform "ios" compiled successfully.

b) xcrun -sdk iphoneos PackageApplication -v "build/Release-iphoneos/MyApp.app" -o "build/Release-iphoneos/MyApp.ipa" --sign "iPhone Distribution: NAME (ID)" --embed "PROFILE_UUID.mobileprovision"

错误:无法从/tmp/iyibGn3aUv/Payload/MyApp.app

推荐答案

问题是你没有合适的方案。当生成phonegap项目时,它不包含任何方案,因此链接到phonegap文件是不正确的。

The problem is that you do not have proper schemes. When phonegap project is generated it does not contain any schemes and thus linking to the phonegap files is incorrect.

转到控制台中的phonegap生成的项目,

Go to the phonegap generated project in console and put 'xcodebuild -list' in the output you will get that there is no schemes in the project.

在xcode中通过phonegap项目生成的xcodebuild -list '
在输出中你会得到没有方案。 - 这将产生计划。

Open generated by phonegap project in the xcode - this will generate schemes.

现在你可以使用xcodebuild(记住填写正确的方案名称)来创建:

Now you can build this using xcodebuild(Remember to fill up the proper scheme name):

xcodebuild -scheme YOURSCHEMENAME - 项目MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE =PROFILE_UUID.mobileprovision - 配置版本

xcodebuild -scheme YOURSCHEMENAME -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release

对于连续集成是坏的解决方案,因为你必须启动xcode GUI来生成方案,但我没有找到任何其他解决方案这个问题。如果有人知道如何使用命令行生成方案,他会很高兴写下来。

For continous integration this is bad solution because you have to launch the xcode GUI to generate the schemes but I did not found any other solution for this problem. If someone know how to generate scheme using command line it would be nice of him to write it down.

这篇关于无法为Cordova iOS应用程序生成发布版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆