Deploymate Command Line Interface

Running Deploymate CLI is done by invoking the binary directly from the bundle and always passing --cli switch as the first argument to your calls. Deploymate binary is located in Deploymate.app/Contents/MacOS/Deploymate . To get an overview of what you can do with CLI, you can pass the --help switch. At the time of writing this article, the output looks something like this:

$ Deploymate.app/Contents/MacOS/Deploymate --cli --help
Usage: Deploymate [-v] --cli -t <target_name> [-V <os-version>] [--help] [--version] [-l {debug,info,warn,error,off}] project
  --cli                               run Deploymate in command line mode
  -t, --target=<target_name>          target to run analysis on
  -V, --platform-version=<os-version> target platform version. Format: xx.yy or xx.yy.zz
  --help                              print this help and exit
  --version                           print version information and exit
  -v, --verbose                       verbose logging
  -x, --forced-exit-code              force set exit code to non-success value if analysis warning are found
  -o, --output-format={default,json,plist} specify CLI output format
  -l, --loglevel={debug,info,warn,error,off} specify logging level
  project                             Xcode project or workspace file

Examples

$ Deploymate.app/Contents/MacOS/Deploymate --cli -t TestTarget TestProject.xcodeproj
This command will run the analysis on the target TestTarget found in project TestProject.xcodeproj taking into account minimum deployment target version as specified in the TestTarget settings.

$ Deploymate.app/Contents/MacOS/Deploymate --cli -t TestTarget -V 5.1 TestProject.xcodeproj
This will run the analysis on the target TestTarget from TestProject.xcodeproj and will check the API compatibility with iOS 5.1 system (assuming the target is an iOS target).

Options

--cli

This switch is absolutely *required* to be the first argument you pass to the binary, otherwise Deploymate will just boot into GUI mode

-t, --target

Use the target switch to specify which target you want to analyze. This argument is also required.

-V, --platform-version

The platform version switch can be used to override the minimum deployment target value for the target. The argument is optional and if omitted, Deploymate will use the default minimum deployment target found in the Xcode project. If you want to check the API compatibility of your target with a specific iOS or Mac OS X version, just set this argument.

Format: xx.yy or xx.yy.zz (e.g. 6.1.2 or 10.8)

-o, --output-format

By default CLI will output analysis results in a human readable format. Deploymate (since v1.2.4) also supports JSON and plist output. This can be done via -o argument and specifying json or plist.

Format: default or json or plist
e.g. -o json, -o plist

Available since Deploymate v1.2.4

-x, --forced-exit-code

Upon completing the analysis, Deploymate will finish with the exit code success (zero) in case there were no problems/errors in the execution regardless of the results the analyzer has found. This behavior is desired to allow correct integration in some CI environments (other than returning non-zero exit code which may lead CI to think that Deploymate actually had errors in the execution).
However, this behavior can be changed by using -x switch which will force Deploymate to return a non-zero exit code (exit code 10, to be more specific) in case any number of warnings have been found in the analyzed project.
Complete list of exit codes can be found below.

Available since Deploymate v1.2.4

Deploymate CLI exit codes:
DMCLIExitCodeSuccess = 0,

/* generic error status code */
DMCLIExitCodeError = 1,

/* insufficient memory */
DMCLIExitCodeInsufficientMemory = 2,

/* error with CLI arguments */
DMCLIExitCodeArgumentsError = 5,

/* Warnings found during analysis (only with force-exit-code arg) */
DMCLIExitCodeWarningsFound = 10
			

comments powered by Disqus