Flags for Local binary

You can use the following flags with Local Testing binaries to suit individual testing cases:

Flag Description Argument
-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
-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’ Folder Path
-h
--help
Display the help text. No args needed
-V
--version
Display the current version of the binary. No args needed
-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
--include-hosts This flag provides granular control over the URLs that you want to tightly bind to your tunnel. Wildcards are supported. Usage:
--include-hosts "filter1" "filter2" "filter3"
Example:
--include-hosts "myinternalwebsite.*" ".*.browserstack.com"
For more details, refer here.
Variadic String
--exclude-hosts This flag supersedes –include-hosts. This flag provides granular control over the URLs that you want to disallow from your tunnel. Wildcards are supported. Usage:
--exclude-hosts "filter1" "filter2" "filter3"
Example:
--exclude-hosts ".*.google.com"
For more details, refer here.
Variadic String
--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.
Usage: host1,port1,ssl?,host2,port2,ssl?.
Example:
localhost,8000,0,abc.example.com,8080,1
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
--force-local 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
--verbose 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. Integer (1 / 2 / 3)
--only-automate This option restricts Binary usage to Automate product, and it cannot be used for Live/Screenshot testing. No args needed
--proxy-host If you are behind the corporate proxy setup, please specify your proxy host using this option. Host URL/IP String
--proxy-port If you are behind the corporate proxy setup, please specify your proxy port using this option. The default value is 3128. Proxy port number
--proxy-user 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 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 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. Identifier 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
--local-proxy-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 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. Proxy port number
--local-proxy-user 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 If your local server is behind a proxy, and it requires authentication - please specify your proxy password using this option. Password string
--daemon 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”
--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
--config-file 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. File path string
--log-file Logs all the output to the file specified. File path string
--pac-file Path to PAC file with which the proxy needs to be set. Note that this path needs to be present on the local machine File path string
--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
--parallel-runs Specify the number of parallel runs. Number

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to automation expert
Talk to an Expert