Licensing
Defender for iOS must have a valid license to run. Defender for iOS must have access to the key when it runs and requires an internet connection to contact the licensing server.
An error message will be displayed if a license key is not specified or if the license key is expired or invalid. To obtain or renew a license, contact the PreEmptive team.
Register a License
To register the license key:
- Internet network should be reachable.
For Build License run the following command:
$ defenderForiOS --register <key>
For User License, you must provide an email address:
$ defenderForiOS --register <key>:email
The license key should be registered, and a success message should be displayed as below:
Using a License
The Defender for iOS application can be run by providing a key at runtime, instead of using the register command. You can provide the license key in the following ways:
Command line: A license key can be provided through the command line using the –license argument. For this:
- Ensure the machine has internet access.
Run Defender for iOS with the
--license
argument:$ defenderForiOS --license <key>:<email> <path to xcode-project> -s <scheme>
Note: The use of the email address is optional, and depends on the license type you are using.
Config file: You can also store your license details in your config.yaml file. To provide a license key through the config file:
- Ensure the machine has Internet access.
Add the license information to your config.yaml file:
license:
key : <value>:<email>
Note: The use of the email address is optional, and depends on the license type you are using.Run Defender for iOS:
$ defenderForiOS <path to xcode-project> -s <scheme>
Environment variable*: License key can be given through environment variable. For this:
- Ensure the machine has internet access.
DEFENDER_FOR_IOS_LICENSE
environment variable should be used to set the license key.Run Defender for iOS:
$ defenderForiOS <path to xcode-project> -s <scheme>
To use your registered license, stored in the .license file:
- Ensure the machine has internet access.
- A License key should have been registered already. Refer to Register a License.
Run Defender for iOS:
$ defenderForiOS <path to xcode-project> -s <scheme>
“Error: Unable to validate license. Please contact support. Server response: Error trying to contact licensing server.” 3. Retry attempts are configurable by using the
IOSDEFENDER_RETRY_COUNT
environment variable.
4. When using a .license
file, it may be necessary to provide Keychain access. You may be prompted as follows:
Register/Validate license through Proxy Server
Defender For iOS can validate and register licenses through a proxy when a direct internet connection is disabled.
Unauthenticated Proxy
If your machine is connected to the internet through an unauthenticated proxy, you can set the proxy details using the following environment variables:
- The
IOSDEFENDER_PROXY_ADDRESS
variable sets the address of the unauthenticated proxy. - The
IOSDEFENDER_PROXY_PORT
variable sets the port of the unauthenticated proxy.
Now, run the following command:
$ defenderForiOS --license <key>:<email> <path to xcode-project> -s <scheme>
- The
Authenticated Proxy
If you need to connect to the internet through an authenticated proxy, you can set the proxy details using the following environment variables (refer to Using a License):
- The
IOSDEFENDER_PROXY_ADDRESS
variable sets the address of the authenticated proxy. - The
IOSDEFENDER_PROXY_PORT
variable sets the port of the authenticated proxy. - The
IOSDEFENDER_PROXY_USERNAME
variable sets the username for connecting to the authenticated proxy. - The
IOSDEFENDER_PROXY_PASSWORD
variable sets the password for connecting to the authenticated proxy.
Now, run Defender for iOS:
defenderForiOS <path to xcode-project> -s <scheme>
The following window is displayed:
Now, click on System Preferences, and enter the Username and Password for the proxy:
Click OK. You should see Defender for iOS run in your terminal window:
Note: If there is any issue with the Proxy server (either the server is off or the entered credentials are incorrect), the following error is given: “Error: Unable to communicate licensing server via proxy server. Please check your proxy server settings and retry.” You may need to restart your system and try again when using an authenticated proxy.- The
Sharing License file with other Users/Systems
If you want to share a floating license file with other users/systems, you need to follow the below steps:
Copy the
.license
file from the following path:/Library/Application Support/PreEmptive Solutions/Defender for iOS/defender.license
Place the .license file on the new machine in the same path from Step 1.
Retrieve the Keychain access details from the current system. To get these details, follow the below steps:
Add the Keychain information to the other system: