Work with Perfecto Connect
Let's have a quick look at the executable usage. Running one of the following without any command outputs the version number and information on the available commands and parameters:

$ ./perfectoconnect
usage: ./perfectoconnect [<flags>] <command> [<args> ...]
Perfecto Connect, Version xx.xx.x
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--version Show application version.
Commands:
help [<command>...]
Show help.
start --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Start Perfecto Connect session
stop
Terminates existing Perfecto Connect sessions
doctor --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Run connectivity tests

> .\perfectoconnect32.exe
usage: .\perfectoconnect32.exe [<flags>] <command> [<args> ...]
Perfecto Connect, Version xx.xx.x
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--version Show application version.
Commands:
help [<command>...]
Show help.
start --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Start Perfecto Connect session
stop
Terminates existing Perfecto Connect sessions
doctor --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Run connectivity tests

> .\perfectoconnect64.exe
usage: .\perfectoconnect64.exe [<flags>] <command> [<args> ...]
Perfecto Connect, Version xx.xx.x
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--version Show application version.
Commands:
help [<command>...]
Show help.
start --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Start Perfecto Connect session
stop
Terminates existing Perfecto Connect sessions
doctor --cloudurl=<cloud> --securitytoken=<securitytoken> [<flags>]
Run connectivity tests
Create a Perfecto Connect tunnel
You create a Perfecto Connect tunnel by running the start
command, including the mandatory parameters cloudurl
and securitytoken.
The following table lists all available parameters.
Parameter |
Description |
---|---|
|
Shows context-sensitive help (also try --help-long and --help-man) |
|
Shows the Perfecto Connect version |
|
The Perfecto Lab that you are registered on, for example
|
|
The security token required to use with Perfecto Connect. For more information, see Generate security tokens. |
|
Runs Perfecto Connect in foreground mode. In foreground mode, all logs are displayed in your console. This is helpful for troubleshooting sessions with Perfecto Support. Backgroud mode is the default. It only outputs the tunnel ID. |
|
Enables bundled proxy logging. See also Work behind a proxy. |
|
Enables verbose logging. |
|
Skips connectivity tests usually performed by the executable before initiating the session. |
|
The full path to the location of the log file, for example |
-d, |
Disables the auto-detection proxy. This is sometimes required for troubleshooting. |
|
The IP address of bridging proxy (optional). |
|
The port of the bridging proxy (optional). |
|
The IP address of the outgoing proxy (optional). |
|
The port of the outgoing proxy (optional). |
|
The username used to connect to the outgoing proxy (optional) |
|
The password used to connect to the outgoing proxy (optional) |
To create a Perfecto Connect tunnel:
- In the command line, navigate to the directory of the Perfecto Connect client.
-
Run the following command to launch a tunnel, depending on your operating system:
Mac and Linux
Copy$ ./perfectoconnect start -c <cloudURL> -s <security-token>
CopyExample$ ./perfectoconnect start -c demo.perfectomobile.com -s eyJhbGciOiJSUz...DxAkAuw82Hao7qrA
Important: On a MacOS device, if you encounter the message "'perfectoconnect' cannot be opened because the developer cannot be verified.", do the following:From the Apple menu, select System Preferences > Security & Privacy > General.
Under Allow apps downloaded from, next to "perfectoconnect" was blocked from use because it is not from an identified developer, click Allow Anyway.
Confirm by clicking Open.
The reply from the application is the tunnel identifier (
Tunnel ID
) that you insert into your Appium/Selenium scripts to associate devices with this tunnel.Important: Running theperfectoconnect
application in the foreground causes the execution to send additional log information to the console. You may need to look for theTunnel ID
. -
Save the Tunnel ID.
Close a Perfecto Connect tunnel
When the Perfecto Connect client runs in background mode and you are done using a tunnel, you can terminate any existing Perfecto Connect sessions by using the stop
command.
The following table lists all available parameters.
Parameter |
Description |
---|---|
|
Shows context-sensitive help (also try |
|
Shows the Perfecto Connect version. |
|
Enables verbose logging. |
|
Disables the auto-detection proxy. This is sometimes required for troubleshooting. |
To close a tunnel:
-
Run the
stop
command as follows, depending on your operating system:This will terminate any existing tunnels on your machine and disconnect all existing connections.
Diagnose connection issues
You can use the doctor
command to troubleshoot connection issues with Perfecto Connect. The command checks if the client can connect to Perfecto services and servers. You run it with the cloud and security token parameters. This section explains how to use the command and lists the errors it might return, along with how to resolve them.
The following table lists all available parameters.
Parameter |
Description |
---|---|
|
Shows context-sensitive help (also try |
|
Shows the Perfecto Connect version. |
|
The Perfecto Lab that you are registered on, for example
|
|
The security token required to use with Perfecto Connect. For more information, see Generate security tokens. |
-d, |
Disables the auto-detection proxy. This is sometimes required for troubleshooting. |
|
The IP address of the outgoing proxy (optional). |
|
The port of the outgoing proxy (optional). |
|
The username used to connect to the outgoing proxy (optional). |
|
The password used to connect to the outgoing proxy (optional). |
|
Enables verbose logging. |
To diagnose connection issues:
-
Run the
doctor
command as follows, depending on your operating system:A successful execution returns the following output:
Copy10:53:31.800 INFO 001 > Perfecto Connect MacOS Client - v19.15.1
10:53:31.814 INFO 002 > Running connectivity tests
10:53:31.814 INFO 003 > Trying to reach Perfecto services...
10:53:52.261 NOTICE 004 > Perfecto services reached successfully
10:53:52.261 INFO 005 > Trying to reach Perfecto servers...
10:53:56.789 NOTICE 006 > Perfecto servers reached successfully
The following table lists possible errors and their resolution.
Error |
Resolution |
---|---|
|
Invalid security token. Generate a new token and try again. For instructions, see Generate security tokens. |
|
Failed to connect to services. Check the parameter values provided and try again. If the issue persists, contact your IT department to place the following on your allow list: |
|
Failed to connect to servers. Check the parameter values provided and try again. If the issue persists, contact your IT department to place the following on your allow list: |
For more help with resolving issues, see Troubleshoot Perfecto Connect.