Flags for Local binary
You can use the following flags with Local Testing binaries to suit individual testing cases:
|-k, --key||It is your private and unique Access Key assigned by Browserstack. The Access Key is required to set up a Local Testing connection.
You can obtain this key from the local testing section of the Settings page: https://www.browserstack.com/accounts/settings
|BrowserStack Access Key||String|
|-f, --folder||Specify the absolute path to the Local folder to be used for testing. This option is to be used when testing a local folder. Refer to the Use Cases for more information.
Example: /home/ubuntu/mysite/ or C:\windows\mysite'
|-h, --help||Display the help text.||No args needed||N/A|
|-V, --version||Display the current version of the binary.||No args needed||N/A|
|-F, --force||Using this option kills all other instances of BrowserStack Local binary running on this machine with the same --local-identifier options. This option will not affect binaries running in remote servers and instances running with different --local-identifier options.||No args needed||N/A|
This flag provides granular control over the URLs that you want to tightly bind to your tunnel. Wildcards are supported.
More details refer here.
This flag supersedes --include-hosts. This flag provides granular control over the URLs that you want to disallow from your tunnel. Wildcards are supported.
More details refer here.
|--only||This flag limits the set of domains that your Local tunnel will resolve for your tests.
Regex is not supported, multiple entries are supported.
This flag is used to restrict the scope of URLs which the Local Binary can connect to, typically for security and compliance purposes.
NOTE: This flag is rendered useless when paired with --force-local; please use --include-hosts or --exclude-hosts depending on your use-case.
|Multiple items of Hosts and Ports||String|
This flag will ensure that, regardless of any other setting, no asset will be resolved via the public internet and any resolution of URLs that your BrowserStack device does will be routed through the Local tunnel.
This flag is typically used to ensure compliance with your network policies.
|No args needed||N/A|
|--verbose [1|2|3]||This option sets the level of logging required. Set 1 to debug issues related to setting up connections. Set 2 for logs related to network information. Set 3 to dump all communication to local servers for each request and response. The default value for this option is 1||1 | 2 | 3 (One of the integers)||Integer|
|--only-automate||This option restricts Binary usage to Automate product, and it cannot be used for Live/Screenshot testing.||No args needed||N/A|
|--proxy-host HOST||If you are behind the corporate proxy setup, please specify your proxy host using this option.||Host URL/IP||String|
|--proxy-port PORT||If you are behind the corporate proxy setup, please specify your proxy port using this option. The default value is 3128.||Port||Integer|
|--proxy-user USERNAME||If you are behind a corporate proxy which requires authentication, please specify your proxy username using this option. As of now, only HTTP Basic authentication is supported.||Username||String|
|--proxy-pass PASSWORD||If you are behind a corporate proxy which requires authentication, please specify your proxy password using this option. As of now, only HTTP Basic authentication is supported.||Password||String|
|--local-identifier UNIQUE STRING||If you are running multiple copies of BrowserStackLocal binary (for better performance or other reasons), please specify unique strings for BrowserStack to uniquely identify them. You will need to specify the same string in Automate tests as well.||Unique String||String|
|--force-proxy||This options routes all traffic via the proxy specified - otherwise, binary tries to connect directly as well for better performance.||No args needed||N/A|
|--local-proxy-host HOST||If your local server is behind a proxy or you are using a proxy to log all communication to your local servers - please specify your proxy host using this option.||Host URL/IP||String|
|--local-proxy-port PORT||If your local server is behind a proxy or you are using a proxy to log all communication to your local servers - please specify your proxy port using this option. Default assumed is 8081.||Port||Integer|
|--local-proxy-user USERNAME||If your local server is behind a proxy, and it requires authentication - please specify your proxy username using this option.||Username||String|
|--local-proxy-pass PASSWORD||If your local server is behind a proxy, and it requires authentication - please specify your proxy password using this option.||Password||String|
|--daemon [start|stop]||Starts or stop the binary as a daemon. Accepts only 2 commands: start, stop. Start will start binary in background.
This option is primarily used in Continuous Integration server scripts.
|"start" or "stop"||String|
|--enable-logging-for-api||Include this option to make sure this binary is exposed to Local API for debugging. For more information refer to https://www.browserstack.com/local-testing#local-api-debugging||No args needed||N/A|
|--config-file CONFIG FILE PATH||Takes a path to the YAML file with a set of parameters to be given to the Binary. Note that parameters given directly to the binary will supercede inputs in the config file.
Check out our sample file here
|--log-file LOG FILE PATH||Logs all the output to the file specified.
Note: Specify the absolute path of the file on your local machine.
|--pac-file PAC FILE PATH||Path to PAC file with which the proxy needs to be set. Note: Specify the absolute path of the file on your local machine.||File Path||String|
|--parallel-runs||Specify the number of parallel runs.||Number||Integer|
|--https-ports||If you want to test local HTTPS server which is behind a proxy, in addition to port 443, please pass comma separated port values. Example: --https-ports 8443,9443||Multiple items of Ports (should not include 443 again)||String|