Questions tagged [xcodebuild]

Questions related to the use of the command-line xcodebuild tool, which is part of Apple's Xcode toolset

builds one or more targets contained in an project, or builds a scheme contained in an Xcode workspace or Xcode project.

Usage

To build an Xcode project, run from the directory containing your project (i.e. the directory containing the projectname.xcodeproj package). If you have multiple projects in the this directory you will need to use -project to indicate which project should be built. By default, builds the first target listed in the project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project.

See More

Building from the Command Line with Xcode FAQ

1388 questions
16
votes
9 answers

xcodebuild exportArchive: no applicable devices found

After upgrading to Xcode 8 with iOS 10, I get exactly this error. I am on latest El Capitan and using the following versions of ruby (I updated via rvm, same with 2.0.0 which is system version) and CFPropertyList: Philipps-MacBook-Pro:mobile-sdk…
Philipp
  • 223
  • 2
  • 8
16
votes
7 answers

Errors converting xcarchive to IPA - single-bundle archive + missing plist method values

I'm trying to convert my xcarchive to an IPA (XCode 7.1.1). The following command xcodebuild -exportArchive -archivePath foo.xcarchive -exportPath . -exportFormat IPA Fails with the error the archive at path 'foo.xcarchive' is not a…
Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
16
votes
5 answers

Generate an .xcscheme file from the command line

I am working on my company's continuous integration server, and the build process is failing because the server does not have access to schemes in an xcode project. Basically, they are using Cmake to generate xcode projects on the fly to be used for…
16
votes
3 answers

Xcode - how to include c library and header file to cocoa project?

How do I add c library to Xcode Cocoa project? Or what is the best option, I don't want to copy them into Cocoa project directory. I have a C project called a which compiles into library a.dylib and header file a.h, the project is located in it's…
stefanB
  • 77,323
  • 27
  • 116
  • 141
16
votes
1 answer

xcodebuild - 'Code Sign error: Provisioning profile X can't be found'

Yet another code sign error. I'm running command: xcodebuild -project $DIR/myproject.xcodeproj -sdk iphoneos5.0 -alltargets and my project.pbxproj "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution:…
Ryan
  • 865
  • 2
  • 10
  • 17
15
votes
2 answers

XCode 13 warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" but no such UI option existst?

I have a product building in Big Sur with Xcode 13 from the commandline via xcodebuild and generates this warning: warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or…
spartygw
  • 3,289
  • 2
  • 27
  • 51
15
votes
2 answers

xcodebuild -exportArchive fails with error Locating signing assets failed

I'm using command line xcodebuild tool to export .ipa files from Xcode archives. It was working fine up to Xcode 8.3.3. The same setup has stopped working with Xcode 9 beta. Now it fails with this error: IDEDistribution: Step failed:…
Vladimir Grigorov
  • 10,903
  • 8
  • 60
  • 70
15
votes
1 answer

xcode command line test with argument passed at launch

I have small problem with implementing xcodebuild command test at CI. I have tests related to specific device language, in xcode I can set "Arguments Passed On Launch" to -AppleLanguages (language). Can I pass that argument using xcodebuild? My…
MichalMoskala
  • 887
  • 1
  • 12
  • 25
15
votes
4 answers

xcodebuild archive generates malformed xcarchive when adding custom build settings

I'm trying to generate an xcarchive using xcodebuild that I can later export as an .ipa using the new functionality added with Xcode 5. This works perfectly fine: xcodebuild -workspace 'MyWorkspace.xcworkspace' -scheme 'MyScheme' -configuration…
Erik Sundin
  • 151
  • 1
  • 4
15
votes
1 answer

xcodebuild: find where the output app file is

Is there anyway to specify where to put the output file (ie .app) for xcodebuild? By default it is in: /Users/myusername/Library/Developer/Xcode/DerivedData/Project-crkyjjbuqqnqqvfxehsjsarzlbbr/Build/Products/Release-iphoneos/Project.app As I need…
hzxu
  • 5,753
  • 11
  • 60
  • 95
15
votes
5 answers

How do I change an existing Xcode target from dynamic to static?

I'm working with an existing project that produces a dynamic library (Cocoa API). I'd rather generate a static library, but if I change the [Linking|Mach-O Type] field from "Dynamic Library" to "Static Library", both the Clean Project and Build…
Eric
  • 2,115
  • 2
  • 20
  • 29
14
votes
3 answers

CLI: Switch keychains in order to sign an xcodebuild

I am trying to switch on a certain keychain, and close another one. I need this because our enterprise & appstore identities are called the same. Right now, I do a "security unlock-keychain" followed by a "security default-keychain" to open the…
Tycho Pandelaar
  • 7,367
  • 8
  • 44
  • 70
14
votes
12 answers

iOS App crashing before entering main() with Xcode 4.2 & iOS 5

Background After upgrading xcode4.1/ios4 to xcode4.2/ios5 I am experiencing crashes while the App is loading and before it even enters main(). I have set a break point in main() but it is never reached. Compiling the project in Xcode 4.1 with a…
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
14
votes
0 answers

xcodebuild not doing incremental builds

I recently checked out a fresh version of our iOS app from git and built from command line via xcodebuild. I then built a second time using the exact same command, while making no changes to files in the repo whatsoever (not even opening them). I…
Jason
  • 13,563
  • 15
  • 74
  • 125
14
votes
3 answers

xcodebuild command line: passing DevelopmentTeam ID for code signing purpose

My App is given one bundleID for App Store distribution. The App also has a small variant for enterprise distribution, thus with another bundleID. The automatic build uses the following command line to set bundleID and pick the right signing…
Chang Kuang
  • 211
  • 1
  • 2
  • 6