2

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? :(

iOS_newbie
  • 31
  • 2

3 Answers3

0

Use Release configuration for the build configuration.

Rukshan
  • 7,902
  • 6
  • 43
  • 61
  • Tried it, didn't work though :( I'm not building this for a release though. I'm trying to build the app so I can run my frank tests on a physical device. I'm still stuck on the first [step](http://www.testingwithfrank.com/device.html) – iOS_newbie Apr 22 '14 at 04:29
  • What difference does compiler optimisation make to a code signing issue? – trojanfoe Apr 22 '14 at 05:12
0

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.

iPatel
  • 46,010
  • 16
  • 115
  • 137
  • I'm not really familiar with certificates and what it means if it's 'installed'. If it means that the certificate is in my Keychain Access, then yes, it's installed. I can even pair the provisioning profile with the proper code signing identity in the Build Settings in Xcode. I just don't know why it's not working in xcodebuild. – iOS_newbie Apr 22 '14 at 05:35
0

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 =====================================================================
trojanfoe
  • 120,358
  • 21
  • 212
  • 242