TeamCity Xcode Build Runner Configuration (Command Line) - xcode

I'm trying to setup a continuous build server with TeamCity and configure it so it can run "xcodebuild -configuration release -sdk iphoneos3.0 clean build".
i installed the plugin for teamcity-xcode integration and for the 'Build Runner' settings, i set it up as
Build Runner: Command Line
Command Executable: xcodebuild -configuration release -sdk iphoneos3.0 clean build
--The error -> [11:52:29]: RunBuildException when running build stage CallRunnerStage: Cannot run process xcodebuild -configuration "Release" : file not found
[11:52:30]: Build finished
But when i set the 'Command Executable' to just "xcodebuild", it works just fine but i need it to build the release config.
Thanks in advance for the help.

use the field command parameters for the parameters.

Related

How to: `xcodebuild -xcworkspace..` with project and swift packages

I have created a xcworkspace to add my iOS.xcproj and local swift package. The workspace builds and runs great from Xcode. What would be the xcodebuild command to do in my CI?
I have been trying using the following:
xcodebuild -workspace [name].xcworkspace -scheme [scheme_name] -configuration [config] -xcconfig [path_xcconfig]
I get this in the output console:
...note: Building targets in dependency order
error: Multiple commands produce <RegisterExecutionPolicyException...
sample:
note: Target 'Firebase_FirebaseInAppMessaging_iOS' (project 'Firebase'): Touch /Users...

what's the default scheme in xcodebuild?

When I run xcodebuild -list, I will get
Targets:
iKM
iKMTests
dailybuildipa
Build Configurations:
Debug
Release
DailyBuild
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
dailybuildipa
DemoApp
Documentation
but in practice ,I did not set specific scheme in my build command(because i did not use workspace for building)
xcodebuild -target dailybuildipa -configuration DailyBuild -sdk iphoneos12.2
so in this situation, which scheme the xcodebuild will use as default scheme?
or it's because xcodebuild can build without any scheme?

xcodebuild failed to build workspace with scheme. Reason - There is nothing to test

I have app with UITests target in Xcode 8.
I can run tests fine using Xcode. Now m trying to run them using command line.
xcodebuild test build-for-testing test-without-building -workspace
a.xcodeproj/project.xcworkspace -scheme testtargetscheme -destination
id=deviceuid -only-testing:StartupTestSuite
But it fails with: xcodebuild failed to build workspace with scheme. Reason - There is nothing to test.
I have checked scheme settings and made sure it does have tests enabled. I also tried above command with normal app run scheme, for which also I have test configured properly.
Any ideas?

Xcode: Is it possible to build in command line exactly as in GUI?

I have an Xcode project that I myself did not author. It has a multi-stage build sequence that is not trivial. For the purposes of static-analysis I am attempting to build it from command line using xcode build. However, the command line invocation produces errors in the build that the GUI build does not.
Is there a sure-fire way to get an Xcode project to build exactly as it did in the command line as in the GUI?
I would be wonderful is there was a way to export an XCODEBUILD invocation from the GUI that covered all the build phases. Is this possible?
I am using an invocation like:
xcodebuild -workspace "PROJECT.xcworkspace" -scheme "MY SCHEME NAME" -sdk iphonesimulator8.1 -configuration Debug

Running Xcode target from command line

I am new to running unit tests using Catch.
I am using the Catch to run unit tests in my Xcode project. I have added a target to my project which includes my Catch files and tests cases. Selecting that target and running from Xcode runs fine. I am now trying to get it to run from the command line which will be the way it is run from Jenkins. I have a shell script that contains:
xcodebuild clean install
xcodebuild -target TestApp -configuration “Debug” -sdk iphonesimulator7.1 CONFIGURATION_BUILD_DIR=TestBuild ONLY_ACTIVE_ARCH=NO
The result is:
** INSTALL SUCCEEDED **
Build settings from command line:
CONFIGURATION_BUILD_DIR = TestBuild
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphonesimulator7.1
--- xcodebuild: WARNING: Configuration “Release” is not in the project. Building default configuration.
=== BUILD TARGET CreativeSDKTest OF PROJECT CreativeSDKImage WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
** BUILD SUCCEEDED **
But the application doesn’t launch in the simulator. Maybe I’m not seeing the obvious but from all the docs I’ve read, this should launch the application.
I think you'll need to tell xcodebuild to test the project:
xcodebuild clean install
xcodebuild -target TestApp -configuration “Debug” -sdk iphonesimulator7.1 CONFIGURATION_BUILD_DIR=TestBuild ONLY_ACTIVE_ARCH=NO clean test
(See the end of the last command)
EDIT: In fact you probably don't even need the first command and just the second will do.

Resources