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:

Create a Perfecto Connect tunnel

You create a Perfecto Connect tunnel by running the start command, including the mandatory parameters cloudurl and securitytoken.

Important: For the Perfecto Connect script to run successfully, the device language must be English.

The following table lists all available parameters.

Parameter

Description

--help

Shows context-sensitive help (also try --help-long and --help-man)

--version

Shows the Perfecto Connect version

-c, --cloudurl=<cloud> 

The Perfecto Lab that you are registered on, for example demo.perfectomobile.com. Make sure to remove the following from the URL:

  • Protocol identifier (such as http:// or https://)
  • .app (if part of the URL)
-s, --securitytoken=<securitytoken>

The security token required to use with Perfecto Connect. For more information, see Generate security tokens.

-f, --foreground

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.

-l, --proxylog

Enables bundled proxy logging. See also Work behind a proxy.

-v, --verbose

Enables verbose logging.

-t, --skiptests

Skips connectivity tests usually performed by the executable before initiating the session.

--logfile=<full path> 

The full path to the location of the log file, for example /tmp/log.out.

-d, --disable-proxy-detect

Disables the auto-detection proxy. This is sometimes required for troubleshooting.

--bridgeproxyip=<ip>

The IP address of bridging proxy (optional).

--bridgeproxyport=<port>

The port of the bridging proxy (optional).

--outgoingproxyip=<ip>

The IP address of the outgoing proxy (optional).

--outgoingproxyport=<port>

The port of the outgoing proxy (optional).

--outgoingproxyuser=<username>

The username used to connect to the outgoing proxy (optional)

--outgoingproxypass=<password>

The password used to connect to the outgoing proxy (optional)

To create a Perfecto Connect tunnel:

  1. In the command line, navigate to the directory of the Perfecto Connect client.
  2. Run the following command to launch a tunnel, depending on your operating system:

    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 the perfectoconnect application in the foreground causes the execution to send additional log information to the console. You may need to look for the Tunnel ID.
  3. 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

--help

Shows context-sensitive help (also try --help-long and --help-man).

--version

Shows the Perfecto Connect version.

-v, --verbose

Enables verbose logging.

-d, --disable-proxy-detect

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

--help

Shows context-sensitive help (also try --help-long and --help-man).

--version

Shows the Perfecto Connect version.

-c, --cloudurl=<cloud> 

The Perfecto Lab that you are registered on, for example demo.perfectomobile.com. Make sure to remove the following from the URL:

  • Protocol identifier (such as http:// or https://)
  • .app (if part of the URL)
-s, --securitytoken=<securitytoken>

The security token required to use with Perfecto Connect. For more information, see Generate security tokens.

-d, --disable-proxy-detect

Disables the auto-detection proxy. This is sometimes required for troubleshooting.

--outgoingproxyip=<ip>

The IP address of the outgoing proxy (optional).

--outgoingproxyport=<port>

The port of the outgoing proxy (optional).

--outgoingproxyuser=<username>

The username used to connect to the outgoing proxy (optional).

--outgoingproxypass=<password>

The password used to connect to the outgoing proxy (optional).

-v, --verbose

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:

    Copy
    10: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

wrong offline token, please make sure that the provided token is valid

Invalid security token. Generate a new token and try again. For instructions, see Generate security tokens.

Post https://demo.connect.perfectomobile.com/v2/client/session/start: Forbidden

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: *.connect.perfectomobile.com:443

Forbidden response on <server-name>:443

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: vpn.*.perfectomobile.com:443

For more help with resolving issues, see Troubleshoot Perfecto Connect.