Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild equivalent of Xcode's "Product > Build For > Testing"

I'm trying to write a script that submits iOS apps to AppThwack (a 'real device' UI testing service). Their guidance is to use the Xcode GUI and build the app using the Build For > Testing option in the Xcode Product menu. This works, but I haven't been able to translate this into the xcodebuild equivalent.

More generally, how do we determine what arguments Xcode is passing to xcodebuild (assuming it uses that tool).

like image 292
Jaysen Marais Avatar asked May 14 '15 07:05

Jaysen Marais


People also ask

What is Xcodebuild?

xcodebuild builds one or more targets contained in an Xcode project, or builds a scheme contained in an Xcode workspace or Xcode project. Usage To build an Xcode project, run xcodebuild from the directory containing your project (i.e. the directory containing the projectname. xcodeproj package).

What is build for testing in Xcode?

XCTest is the automation testing framework provided in Xcode with built-in support to help you set up and execute your tests. Testing is an important step of developing any project which can help you find bugs in your source code.

What is Allowprovisioningupdates?

Aug 14, 2020. Since Xcode 9, Apple provides automatic code signing identity management from the command line by using the xcodebuild command. Using the “allowprovisioningupdates” flag, you can enable code signing; however you may get errors like: Your session has expired.


2 Answers

This is now possible as of Xcode 8 (in beta at time of writing). Use build-for-testing.

Example:

xcodebuild -workspace <workspace> -scheme <scheme> -destination 'generic/platform=iOS' build-for-testing

To switch to a beta version of xcodebuild, use xcode-select:

sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer

like image 191
brandenbyers Avatar answered Oct 27 '22 00:10

brandenbyers


xctool has a flag called build-tests that will do just that.

(As of this post, it is not currently Xcode 7 compatible, but they are working on it.)

like image 29
Albert Bori Avatar answered Oct 26 '22 23:10

Albert Bori