Gluon CLI

BrowserMobility is powered by Gluon, an API first distributed hypervisor for managing iOS simulators. The main interface to the Gluon APIs is the gluon-cli command line tool.

Installation

To install the gluon-cli, run this command in a terminal on MacOS:

                        npm i -g @jhenrycode/gluon-cli
                    

After installation, run gluon-cli to ensure the command line tools were installed correctly.

Credentials

Setting credentials for the gluon CLI can be done by calling the set-credentials command on the CLI. The effect of executing this command is to write the provided gluon API key to a file which can be found at ~/.gluon/config.

Alternately, you can set an environment variable called GLUON_API_KEY with the value of your account api key. When both the GLUON_API_KEY environment variable and the ~/.gluon/config are both set, the environment variable will be used.

Commands

account-info

Retrieves top-level account information for the configured account. The account information is returned in json format with the following fields:
                                {
                                    id,
                                    name,
                                    adminAccountEmail,
                                    publicKey
                                }
                        
The publicKey is the public part of the RSA keypair used to sign all commands executed against the Gluon APIs. Gluon is a Zero Trust environment, and as such all API requests must be signed and validated.

hosts

Retrieves registered host information for the configured account. The host information is returned in json format with the following fields:
                                {
                                    id,
                                    accountId,
                                    machineIp,
                                    hostType,
                                    ipAddress,
                                    commandPort,
                                    agentPort,
                                    simulatorCount,
                                    maxSimulatorCount,
                                    lastHeartBeat,
                                    created,
                                    updated
                                }
                        

The machine IP is the IP of the base-level host. This is usually the IP address of the physical machine, but could be the IP address of a Virtual Machine that is acting as the hypervisor layer in a nested virtualization environment.

The host type will be an enumerated value with the following values:

  • 1 - AWS
  • 2 - MacStadium
  • 3 - OnPrem (self hosted)

host-simulators

Input argument

: hostId

Retrieves the list of all simulators that are registered to the account. The simulator information is returned in json format with the following fields:
                                {
                                    id,
                                    accountId,
                                    hostId,
                                    name,
                                    runtime,
                                    dataPath,
                                    dataPathSize,
                                    logPath,
                                    logPathSize,
                                    isAvailable,
                                    lockId,
                                    deviceTypeIdentifier,
                                    state,
                                    currentSessionId,
                                    webDriverPort,
                                    created,
                                    updated
                                }
                        

available-simulators

Retrieves the list of all simulators that are not currently in use. The simulator information is returned in json format with the following fields:
                                {
                                    id,
                                    accountId,
                                    hostId,
                                    name,
                                    runtime,
                                    dataPath,
                                    dataPathSize,
                                    logPath,
                                    logPathSize,
                                    isAvailable,
                                    lockId,
                                    deviceTypeIdentifier,
                                    state,
                                    currentSessionId,
                                    webDriverPort,
                                    created,
                                    updated
                                }
                        

create-simulator

Input argument

: hostId

Input argument

: name

Input argument

: deviceType

Input argument

: runtime

Input argument

: webDriverPort

Creates a new simulator on the specified host.

The runtime and deviceType options can be retrieved using the host-runtimes command.

delete-simulator

Input argument

: hostId

Input argument

: simulatorId

Deletes the specified simulator from the specified host.

host-logs

Input argument

: hostId

Retrieves the gluon host agent logs from the specified host.

host-runtimes

Input argument

: hostId

Retrieves the installed iOS runtimes from the specified host. The supported device types for each runtine are returned as children of each runtime, in the following structure:
                            [runtime]
                            =================
                            name
                            identifier
                            version
                            supported devices:
                                [device type]
                                =================
                                name
                                identifier
                                product
                        

account-sessions

Retrieves a list of sessions for the account. The session information is returned in json format with the following fields:
                            {
                                sessionId,
                                accountId,
                                sessionRecordingUri,
                                sessionStartTime,
                                sessionEndTime
                            }
                    
The session recording URI cannot be accessed directly. Make a call to the session-video-url command to get a one-time uri that will allow you to view the video of the session.

session-video-url

Input argument

: sessionId

Retrieves a one-time signed URL that can be used to view a session video. The url will expire after 30 minutes.

provision-host

Input argument

: ipAddress

Input argument

: agentPort

Input argument

: commandPort

Input argument

: maxSimulatorCount

Input argument

: sshUserName

Input argument

: sshPassword

Provisions a new host, using the supplied credentials.

For AWS host provisioning, see the AWS integration guide.

set-credentials

Input argument

: Gluon API key

Sets the gluon api credentials ont he local machine.

run-sample-test

Runs a sample test against your provisioned capacity to ensure everything is working correctly.