iphone - xcode构建错误

标签 iphone xcode shell

我试图通过运行 shell 脚本来构建我自己的 xcodeproject,在编译大部分文件后出现此错误。

CodeSign build/Release-iphoneos/moai.app
    cd /Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios
    setenv CODESIGN_ALLOCATE /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    /usr/bin/codesign --force --sign "iPhone Distribution: Vanilla Breeze Co., Ltd." --resource-rules=/Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios/build/Release-iphoneos/moai.app/ResourceRules.plist --entitlements /Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios/build/MoaiSample.build/Release-iphoneos/moai.build/moai.xcent /Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios/build/Release-iphoneos/moai.app
/Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios/build/Release-iphoneos/moai.app: User interaction is not allowed.
Command /usr/bin/codesign failed with exit code 1

我似乎在分发证书方面遇到了问题,但我不知道该怎么办。

这是我的 shell 脚本

#!/bin/sh
ProjectName="MoaiSample"
TargetName="moai"
SchemeName="MoaiSample"
#SDKS="iphoneos5.0"                                                                                                                                   
CONFIGURATIONS="Release"
ProvisionRelease=VBEnterpriseDistribution.mobileprovision
PASSWORD=password
IDENTITY="iPhone Distribution: Vanilla Breeze Co., Ltd."
KEYCHAIN="/Users/vb_admin/Library/Keychains/login.keychain"
PROJECT_PATH="/Users/Shared/Jenkins/Home/jobs/moai-test/workspace/moai-dev/xcode/ios "


# move to project folder

cd $PROJECT_PATH

# unlock security                                                                                                                                     
security unlock-keychain -p $PASSWORD $KEYCHAIN
# clean previous build files                                                                                                                          
xcodebuild -project $ProjectName.xcodeproj -target $TargetName -configuration $CONFIGURATIONS clean
# build project                                                                                                                                       xcodebuild -project $ProjectName.xcodeproj -target $TargetName -configuration $CONFIGURATIONS
# archive ipa file                                                                                                                                    #cd build                                                                                                                                             rm -Rf Payload $TargetName.ipa

mkdir Payload
cp -r build/Release-iphoneos/$TargetName.app Payload
zip -r $TargetName.ipa iTunesArtwork Payload

关于我的构建失败的原因有什么想法吗?

提前致谢

最佳答案

你读过Running xcodebuild from a forked terminal吗? ?

从命令行运行时,钥匙串(keychain)列表似乎可能不同。

The difference that most people have also seen is that if you run security list-keychain you'd get:

$ security list-keychain
  "/Library/Keychains/System.keychain"
  "/Library/Keychains/System.keychain"

But when running in the ssh shell, I'd get:

$ security list-keychain
    "/Users/<i>user_account_name</i>/Library/Keychains/login.keychain"
    "/Library/Keychains/System.keychain"

建议创建一个不与用户帐户关联的钥匙串(keychain)。

关于iphone - xcode构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12066352/

相关文章:

iphone - Xcode 4 无法将 iPhone 识别为配置设备

iphone - UIGestureRecognizer Action 限制

python - 如何使用python执行 '<(cat fileA fileB)'?

linux - 如何将 "which"与正则表达式或其他方式一起使用以在 $PATH 中查找命令

iphone - 您如何检查 uiview 何时出现在屏幕上/完成绘图?

iphone - 如何从zbar获取条码类型?

iPhone 引用不同目录中的资源

iphone - 向 IB 中的 UIToolbar 项目添加功能

ios - 编译架构错误

Java Unix Shell 更改目录