Reputation: 166
I'm trying to build my own xcodeproject by running a shell script, and I'm getting this error after compiling most of the files.
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
It seems like I'm having problems with distribution certificate, but I can't figure out what I should do.
Here is my shell script
#!/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
Any ideas on why my build fails?
Thanks in advance
Upvotes: 2
Views: 3293
Reputation: 42588
Have you read Running xcodebuild from a forked terminal?
It seems like the keychain list can be different when running from the command line.
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"
The recommendation is create a keychain not associated with a user account.
Upvotes: 4
Reputation: 4527
Please check for a valid certificate for your app. Set the Provisioning Profile right and try again.
Upvotes: 0