Connect Android mobile devices
You can connect Android devices to the Mobile Center server, or to a connector machine.
When connecting the device for the first time, there are a few steps that you need to perform on each device that you intend to connect to Mobile Center. After the initial connection has been set up, the device is "plug-and-play".
- Check that your devices are supported by Mobile Center.
- Enable Developer options. In general, on most devices with Android 4.2 and higher, you can do this by navigating to Settings > About phone and tapping the Build number seven times.
Under Developer options, enable the following:
- Stay awake
- USB debugging
- Allow mock locations
To enable GPS simulation when using Android 6.0 and higher, set the mock location app to MC Agent after connecting the device Mobile Center. (Settings > Developer options > Select mock location app). If you reinstall the Agent for any reason, you will need to repeat this step.
- Under Developer options, disable Verify apps via USB (available in Android 4.20 and higher).
- Enable the following additional settings:
- In Settings > Display, select Auto rotate screen.
- If you simulate GPS events during your test, prevent collisions with your real location from WiFi/3G/LTE by enabling GPS only in Settings > Location > Mode.
- If required by the apps being tested, make sure that there is an active Internet connection.
Connect devices to Mobile Center
Devices can be connected to the Mobile Center server, or to a connector machine. If you are connecting devices to a connector machine, see Install the connector on a Windows machine, Install the connector on a Mac machine, or Install the connector on a Linux machine machine.
Before connecting a device, clean the device of all apps that were installed using a previous version of Mobile Center.
To connect a device to the Mobile Center server:
- Connect the device to the server machine using a USB cable.
Note: On some devices, when you connect the device via USB, a security message opens requesting you to allow USB debugging or trust the connected computer. Accept the warning.
The following are automatically installed on the connected device:
- Services for the remote viewer
- The Agent application
A number of settings are also configured on the device.
- Wait until the Agent is running on the device. If the automatic connection to the Agent does not succeed, see Troubleshooting Android devices.
Certain Samsung devices running Android 7.0, use a battery optimization tool that causes this issue. If you encounter disconnection issues, perform the following:
- Open Settings > Apps.
- Click the More button (three vertical dots) and select Special Access.
- In the Special Access area, choose Optimize battery usage.
- In the Optimize battery usage area, choose All apps.
- Scroll to the MC Agent app and switch it to Off.
Certain Android devices, primarily those manufactured by Chinese vendors, use a security tool that affects the memory and battery usage. If you encounter disconnection issues, perform the following:
- Enable Autostart for the MC Agent: Open the device’s Security app from the Home page, and click Permissions. Select Autostart, find the MC Agent app, and enable it.
- Turn off the battery saver: Open the device’s Security app from the Home page, and click Battery. Set Battery saver to Off. Alternatively, to work with the battery saver on, select App battery saver and find the MC Agent app. Select No Restrictions.
Certain LG devices disconnect after changing the orientation from the control panel in the remote view. The log file contains an exception message. If this occurs, perform the following:
Check the device card of the disconnected device on the DEVICES tab and determine its model number. This is usually the manufacturer name "LG" followed by a hyphen and a short string. For example, LG-D855.
- Open the Connector.properties file in C:\Program Files\Mobile Center Server\server\conf (by default).
- Add the model of the disconnected device to the “VNC_USE_64ARTIFACT_MODELS” row. Save and close the file.
- Restart the connector service (Start > Mobile Center Connector > Restart Mobile Center service) , and verify that the connection is stable after you change the orientation.
If an app crashes or is terminated forcefully during a recording session, your actions will no longer be recorded even if you restart the app. You must re-record your session from the beginning.
You can work with Dexguard security by compiling your app in Dexguard. Follow these steps:
- Upload your original, packaged or non-packaged app to Mobile Center.
- Record a test on the original app.
Recompile the app in Dexguard with the following options:
"-keepresourcexmlattributenames **/id -keepresources id/*"
- Upload the Dexguard-wrapped version of the app to Mobile Center.
- Replay the testing using the Dexguard-wrapped version of the app.
Cross-domain iframe calls are not supported. For example, if your test uses an iframe that points to a web page in another domain, it will fail.
An Android limitation may cause a device to issue the message INSTALL_FAILED_INSUFFICIENT_STORAGE while installing certain apps. Workaround: Restart the device.
If your device hangs when trying to open an app, it may be caused by the app's secure layout flag.
Workaround: Manually remove the secure layout flag. If you are testing a packaged app, see Package an Android app manually for more details. For non-packaged apps, see Manually enable remote content debugging .
When working with hybrid non-packaged apps, make sure that remote content debugging is enabled. For details, see Enable remote content debugging of Android apps.
In order to work in the remote view on a device with a Good Connect client, you must set the Prevent Android Screen Capture policy to Off. The release version of 18.104.22.1687.117 and above is required for the policy to take effect. For details, see the Blackberry Knowledge Base article.