Command Line Options
The Defender for iOS CLI supports short and long option names. The short names start with a single dash (-), while long names start with two dashes (--). Many options have only long names. If there are multiple options, this documentation will show the alternatives separated by a | character.
Defender for iOS will also support nearly all settings provided through a configuration file, which can be used in addition to, or instead of command line arguments. Please see our Configuration File documentation for using this file.
Required Arguments
To process a project, Defender for iOS always requires the path to your Xcode project as your first command line argument, followed by any additional arguments. Defender for iOS will only process a single build scheme, regardless of Xcode settings:
$ defenderForiOS {path-to-xcode-project} --scheme {target-build-scheme}
Example:
$ defenderForiOS ~/Desktop/iOSDev/SampleProject/SampleProject.xcodeproj --scheme iOSSample
General Settings
The following arguments are used for various settings and general configuration of Defender for iOS:
- -V | --version: Show the Defender for iOS version number.
- -h | --help: Show a list of available arguments and their descriptions.
- -c | --config: Specify the path for your configuration file. The file name should be config.yaml . Please see Configuration File documentation for additional information.
- -o | --output-dir {path-to-output-dir}: Specifies the output directory of your compiled application.
- -d | --log-file-dir {path-to-log-file-dir}: Specifies the output directory of logs created by Defender for iOS. Default value is ‘~/PreEmptive/log’. See Log documentation for additional information.
- -l | --log-file-level {0,1,2, or 3}: Specifies the amount of information to be stored in log files. Default value is 1. See Log documentation for additional information.
- --restrict-file {values}: Specify a list of files that should NOT be processed by Defender for iOS. The values should be separated by commas.
Licensing
Defender for iOS requires a valid license for use. The following arguments allow you to provide the necessary licensing information. Please refer to the Licensing documentation for additional information, including how to register a new license and configure a proxy. A license MUST be available and should be specified either as a command line argument or within your configuration file.
- --license {key} OR --license {key}:{email}: Specify the license via the command line. Email may be optional, depending on the license type you are using.
Renaming
The following arguments apply to renaming obfuscation with Defender for iOS. Please review the Renaming & Control Flow documentation for additional information.
- --disable-renaming {true or false}: Setting the value to ‘true’ will disable renaming obfuscation for your project. Default value is false (renaming is enabled).
- -F | --filter-symbols {value}: Renaming obfuscation filtering for both Objective-C and Swift. For Swift, this list filters classes, structs, enums and protocols. For Objective-C, the list filters interfaces and protocols.
Control Flow
The following arguments apply to control flow obfuscation with Defender for iOS. Please review the Renaming & Control Flow documentation for additional information.
- --disable-control-flow={true or false}: Setting the value to ‘true’ will disable control flow flattening for your project. Default value is false (control flow is enabled.)
- --filter-control-flow={value}: Control Flow obfuscation filtering for both Objective-C and Swift. Specify Swift and Objective-C methods to ignore, as a comma-separated list.
Crash Dump Processing
In the event your application crashes, the data inside the crash dump file will be obfuscated. To de-obfuscate the data from the crash dump file, you can use the --translate-crashdump argument as follows:
- --provision-profile {value}: Specify the name and location of your Provision Profile. This may be required if a plist file is not present.
- --signing-identity {value}: Providing a signing identity as a command line argument will override the identity within the project.
- --signing-plist {value}: Used to de-obfuscate your protected application. The map file contains a list of original methods, strings, and other values and their corresponding renamed values.
Build Configuration
These arguments specify various build settings for your project. By default, Defender for iOS will utilize your build scheme for these settings.
- --build-type {ipa or binary}: Specify the expected processing result type. Default value is ipa.
- --build-configuration {debug or release}: Specify the build configuration type.
- --build-sdk {debug or release}: Specify the build iOS SDK type type.