Dev Access

The Dev Access feature lets you route devices from the Mobile Center 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 will only be accessible through the remote view in Mobile Center, but not via Micro Focus integrated testing tools.

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

iOS prerequisites for Dev Access

To use Dev Access on an iOS device, you must have the socat tunneling tool on your machine.

To install it on a Mac machine, run the brew command:

brew install socat

If you do not have brew package manager, retrieve and install it with the following command :

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Note: If you have SIP (System Integrity Protection) enabled, you will not be able to install brew with the curl command. Disable SIP to use the above command.

Android prerequisites for Dev Access

Follow these guidelines:

  • The Android ADB component must be present on the machine. If you have a Mobile Center connector installed on the machine, the default ADB location is C:\Program Files\Mobile Center Connector\connector\android-sdk-windows\platform-tools.
  • You should have a basic knowledge of ADB. For details, see the Android Debug Bridge documentation.
  • Port 5037 must be available. This port may be used by the Mobile Center 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 Dev Access

You must perform the following steps 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 will be 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 Mobile Center. If you don't already have an execution key, you can generate one. For more details, see Generate and manage access keys (non-admin users).
  6. Paste the execution token and press enter, or type login -c "your execution key" to login again.
  7. The console welcomes you.

Interact with your device

Once your console is open and you have connected to the MC server, you can interact with the devices and the server using the Dev Access 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 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 Dev Access on Android.

      Note: If the path to your ADB executable contains spaces, you must 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.

Back to top

Dev Access 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 Mobile Center server. You require an execution key to do this.

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

logout

Logs out from the Mobile Center server. This command has no parameters.

list

Lists information, based on the specified parameter:

  • devices. Lists all of 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 MC server, you can 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 Dev Access on Android

  • Certain adb command are not supported for the Dev Access feature. 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 Developers website.
  • When using Dev Access for a device, it will only be accessible through remote view in Mobile Center, but not via testing tools such as UFT, LeanFT, and so forth.

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

Back to top

Known issues for Dev Access 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. Therefore we recommend that you manually retrieve the required device support folders, prior to using the device in Dev Access mode.
  • When using Dev Access, you will lose access to any local iOS device connected to your computer, as they will be replaced by the Mobile Center remote devices.
  • If you were unsuccessful in stopping your Dev Access session, you must manually unlock the device from the DEVICE LAB tab's DEVICES page.
  • If you start Dev Access using a specific tunnel file, and then begin another Dev Access session in another thread using a different tunnel file, you will be unable to stop the first tunnel file's session. Manually unlock the device from the DEVICE LAB tab's DEVICES page.

  • You can only access devices from one connector at a time.

Back to top

See also: