Dev Access CLI tool

The Dev Access Command Line Interface tool lets you route devices from the Digital Lab device lab to an IDE and other development and debugging tools built on ADB for Android, or iDevice for iOS.

When using Dev Access for a device, the device is only accessible through the remote view in Digital Lab, but not via OpenText integrated testing tools.

Note: Before using Dev Access, stop the connector on your machine. For details, see Start, stop, and restart the connector.

Android prerequisites for Dev Access CLI tool

Follow the Android prerequisites for the Dev Access CLI tool:

  • The Android ADB component must be present on the machine. If you have a Digital Lab connector installed on the machine, the default ADB location is C:\Program Files\UFT Digital Lab Connector\connector\android-sdk-windows\platform-tools.
  • Basic knowledge of ADB is required. For details, see Android Debug Bridge in the Android Developer documentation.
  • Port 5037 must be available. This port may be used by the Digital Lab server or connector, so make sure to stop these services on the machine upon which you intend to run Dev Access.

Back to top

Set up the Dev Access CLI tool

The following steps must be performed for each device that you want to route to your IDE.

To set up the device to work with your IDE:

  1. Navigate to the Device Lab > Devices page.

    • In card mode, hover over the device's card and click the Dev Access button .
    • In list mode, select a device and click Dev Access.
  2. The Dev Access Download dialog box prompts you to select the operating system of the machine through which you are accessing the device. Choose the operating system, and click Download to retrieve the device tunnel file.
  3. Extract the contents of the archive file to a location on your machine with write permissions.

  4. Run the batch file.

    • On Windows, double-click the dev-access.bat file.
    • On Linux and Mac, run the dev-access.sh script from the terminal window with the sudo command. This script must have permission to be executed.
  5. The console opens and prompts you for your credentials for Dev access to Digital Lab. If you don't already have an execution key, generate one. For more details, see Generate and manage access keys.
  6. Paste the execution key and press enter, or type login -c "your execution key" to login again.
  7. The console welcomes you.

Interact with your device

After your console is open and you have connected to the Digital Lab server, you can interact with the devices and the server using the Dev Access CLI commands. Type --help or -h to see a list of the commands.

For Android devices, once you are connected, you work over a virtual ADB to submit commands and debug devices as you would with devices connected directly to your machine.

To interact with your device:

  1. Locate the device for which you generated a tunneling file. Type list devices in the console and copy the ID of the device for which you created a tunnel file.

  2. In the console, type start <id>. If you receive any warnings, use the config command to set the correct values. For details, see the Dev Access CLI commands. The Device's card (or row entry in list view) in the lab console, indicates that the device is locked and has been routed via Dev Access.
  3. Interact with the device:

    • For Android devices via the ADB tool: Open an additional command line window (aside from the Dev Access console) and issue standard ADB commands. For a partial list of the supported ADB commands, see Known issues for the Dev Access CLI tool on Android.

      Note: If the path to your ADB executable contains spaces, define the path in the dev-access.properties file, located in the extracted folder. Use the backslash as an escape character for a backslash. For example, android.adb.exec=C\:\\adb 3\\adb.exe.

    • For Android devices via the Android Studio:

      1. If you started Dev Access for a single Android device, open a command prompt and run adb logcat.
      2. If you started Dev Access for more than one Android device, run adb devices. Copy the serial number of the device your want to work with. Run adb -s <serial number> logcat.
      3. Build, run, and debug the app from the Android Studio.
    • For iOS devices, locate the device and interact with it in the usual manner.

To switch back to your local devices, close the CLI tool.

Back to top

Dev Access CLI commands

The following table lists the most common commands available from the Dev Access console. Type --help or -h to list the available commands.

For details about commands that require parameters, type the command without any parameters.

login

Logs in to the Digital Lab server. You require an execution key to do this.

For example: login -c "my execution key".

logout

Logs out from the Digital Lab server. This command has no parameters.

list

Lists information, based on the specified parameter:

  • devices. Lists all the devices with their platform, name, OS version, device ID, and status. Use this command to obtain the device ID for use with the start or stop commands.
  • platforms. Lists the device platforms that are available, for example android and iOS.
  • configs. Lists the server and device configuration information, such as URL host and port.
startStarts the specified device. Use the Device ID as retrieved from the list devices or list configs commands. For example start 56980739ab78.
stopStops the specified device and frees it for other users. For example stop 56980739ab78.
clearClears the Dev Access console. This command has no parameters.
config

Lets you configure information, using the following syntax:

config [-s] -n=<name> [-p=<platform>] -v=<value>

  • -s Saves the configuration with the specified name (-n) for future use.
  • -p The platform upon which to perform the configuration: android or ios.
  • -n. The name of the configuration to apply or, if following the "-s" option, the name of the configuration to apply. The possible configurations are:

    • adb.version - the ADB client version
    • adb.port- the mock ADP port upon which to listen
    • adb.autokill- Kill the existing running ADB thread (true/false )
    • adb.exec- The ADB installation path
  • -v The configuration value for the -n parameter. For example:

    • –n adb.autokill –v true
    • –n adb.version –v 38
    • –n adb.port –v 5038
    • –n adb.exec –v c:/folder/adb.exe

For example, if the console warns you that your version of ADB does not match that of the Digital Lab server, change it using the config command: config -n adb -v 39

exitEnds the Dev Access session. This command has no parameters.

To learn more about the config command for android and the default values, type config -p android -n.

Back to top

Known issues for the Dev Access CLI tool on Android

  • Certain adb commands are not supported by the Dev Access CLI tool. A partial list of the unsupported adb server commands is: ppp, reverse port forwarding, disable/enable - verity, remount, reboot, sideload, root, unroot, usb, and tcpip. For details, see the Android Developer website.
  • When using Dev Access CLI for a device, it is only accessible through remote view in Digital Lab, but not via testing tools such as UFT and UFT Developer.

  • When using Dev Access CLI for a device, the device is not accessible through the server's built-in Appium, but it can be accessed with an external Appium server, based on the Dev Access CLI service.

Back to top

Known issues for the Dev Access CLI tool on iOS

  • Currently the Dev Access capability is only certified for the Xcode IDE on a local Mac machine. Other third party IDEs may function, but the behavior many not be optimal.
  • If the remote access is through a weak or slow connection, there may be difficulty in retrieving the required symbols and device support files in Xcode. We recommend that you manually retrieve the required device support folders before using the device in Dev Access mode.
  • When using Dev Access CLI, you lose access to any local iOS device connected to your computer because they are replaced by the Digital Lab remote devices.
  • If you were unsuccessful in stopping your Dev Access CLI session, manually unlock the device from the Device Lab tab's Devices page.

Back to top

See also: