Code Sign Error in xcodebuild on simple Single-View Application

264 Views Asked by At

xcodebuild fails when I build from the command line. This is the error I'm always getting:

Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”, however, no such provisioning profile was found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'

However, when I build it from Xcode, it builds fine and runs smoothly on the device. The Fix Issue button doesn't appear in the General Tab in Xcode, which explains why it works on Xcode. I've been researching since yesterday why I can't build it through xcodebuild. Help anyone? :(

The xcodebuild command I've been using (Straight from Frank's website):

xcodebuild \
-target <app_target (optional, if you have only one)> \
-xcconfig ./Frank/frankify.xcconfig \
-arch armv7 \
-configuration Debug \
-sdk iphoneos \
DEPLOYMENT_LOCATION=YES \
DSTROOT="<full_path_to_your_xcode_project_directory>/Frank/frankified_build" \
FRANK_LIBRARY_SEARCH_PATHS="<full_path_to_your_xcode_project_directory>/Frank" \
clean build

I'm testing this with a Single View Application Project so I could rule out factors from the real project I'm working on. Any ideas? :(

3

There are 3 best solutions below

2
Rukshan On

Use Release configuration for the build configuration.

1
iPatel On

There is problem in your certificates as they are not installed properly on your machine, did you generate the certificate on your machine, or if you did in any other machine, then you first need to install certificate on that machine so that it can configure with with private key and then try to export certificate along with its private key.

0
trojanfoe On

You need to unlock your keychain before running xcodebuild:

$ security unlock-keychain
(enter keychain password)
$ xcodebuild

I have the following at the end of my ~/.bashrc because I'm always forgetting:

echo =====================================================================
echo You might want to unlock the keychain using:
echo \$ security unlock-keychain
echo =====================================================================