2

我正在尝试通过运行 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

关于为什么我的构建失败的任何想法?

提前致谢

4

2 回答 2

4

你读过Running xcodebuild from a forked terminal吗?

从命令行运行时,钥匙串列表似乎会有所不同。

大多数人也看到的不同之处在于,如果您运行 security list-keychain 您会得到:

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

但是在 ssh shell 中运行时,我会得到:

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

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

于 2012-08-22T04:57:48.167 回答
0

请检查您的应用程序的有效证书。正确设置供应配置文件并重试。

于 2012-08-22T04:57:25.777 回答