简体   繁体   English

为iPhone构建iOS应用程序可以从xCode运行,但不能从命令行运行(xcodebuild)

[英]Building iOS app for iPhone works from xCode but not from command line (xcodebuild)

I am currently trying to streamline our build and release process with an automated build which runs on an OSX server machine , a MacMini running OSX 10.6.7 with xCode 4.0.1 and iOS SDK 4.3 installed (latest release from Apple). 我目前正在尝试使用在OSX服务器计算机上运行的自动构建来简化我们的构建和发布过程,MacMini运行OSX 10.6.7,安装了xCode 4.0.1和iOS SDK 4.3(Apple的最新版本)。 I have followed Mike Nachbaur's excellent guide and it feels like I'm almost there but I still have one final obstacle to overcome. 我跟随Mike Nachbaur的出色指导,感觉我几乎就在那里,但我还有一个最后的障碍需要克服。

So. 所以。 We have our app which build fine on: 我们的应用程序构建良好:

a) My laptop from within xCode a)我的笔记本电脑来自xCode

b) My laptop from command line with xcodebuild b)我的笔记本电脑来自xcodebuild的命令行

c) the build machine from within xCode c)来自xCode内的构建机器

BUT it does not work on 但它不起作用

d) the build machine from the command line with xcodebuild. d)使用xcodebuild从命令行构建机器。

Here is the end of the console output: 这是控制台输出的结束:

CreateUniversalBinary build/Distribution-iphoneos/CallControl.app/CallControl normal "armv6 armv7"
    cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /usr/bin/lipo -create /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv6/CallControl /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv7/CallControl -output /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl

GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
    cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/usr/bin/dsymutil /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM
ProcessProductPackaging "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
    cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    <com.apple.tools.product-pkg-utility> "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision

** BUILD FAILED **

+ failed build
+ echo 'Failed: build'
Failed: build
+ exit 1
Notifying upstream projects of job completion
Finished: FAILURE

On my machine, it looks almost the same: 在我的机器上,它看起来几乎相同:

GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
    cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
    /Developer/usr/bin/dsymutil /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM

ProcessProductPackaging "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
    cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
    <com.apple.tools.product-pkg-utility> "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision

** BUILD SUCCEEDED **

But success... It does not matter if I start the build directly from the command line on the build machine or if it is started by Hudson, same result. 但是成功......如果我直接从构建机器上的命令行启动构建,或者如果它是由Hudson启动,则结果相同无关紧要。 The certificate pointed out above seems to be in place. 上面提到的证书似乎已经到位。

I'm almost ready to give up on this, so I would very much appreciate any help to shed some light upon the matter! 我几乎已经准备好放弃这个了,所以我非常感谢任何帮助来解释这个问题!

Best regards, Anders 最好的问候,安德斯

I encountered the exact error that you showed above on my build machine after updating to a new distribution certificate and provisioning profile. 在更新到新的分发证书和配置文件后,我遇到了您在我的构建计算机上显示的确切错误。 After the ProcessProductPackaging step, it would just display the ** BUILD FAILED ** message. 在ProcessProductPackaging步骤之后,它将只显示** BUILD FAILED **消息。

However, when running the build manually on the build machine, I encountered the KeyChain permission dialog. 但是,在构建计算机上手动运行构建时,我遇到了KeyChain权限对话框。 Hitting "Allow Always" fixed the problem. 点击“始终允许”修复问题。

That in addition to unlocking in the build script: 除了在构建脚本中解锁之外:

security unlock -p $PASSWORD

Add this line of code to your script: 将以下代码行添加到脚本中:

security list-keychains -s $KEYCHAINFILE

This has fixed the issue for me. 这为我解决了这个问题。

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

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