Configure Android Devices for Proxy Recording

After you have created a proxy recorder, you can start recording performance tests with various devices or browsers, including Android phones and tablets, as described in this article.

Enable Debug Mode

First, ensure your Android app has the following permissions to allow for the proxy recorder to record traffic on it while in debug mode:

  1. Ensure the application has the following permissions:
    <uses-permission android:name=“android.permission.INTERNET”/>
    <uses-permission android:name=“android.permission.ACCESS_NETWORK_STATE” />
    <uses-permission android:name=“android.permission.ACCESS_WIFI_STATE”/>
  2. In the application tag, include the following attribute:
    android:networkSecurityConfig=“@xml/network_security_config”
  3. Create the XML directory in base/src/{packageMain}/res and add the following XML content to the file network_security_config.xml:
    <?xml version=“1.0” encoding=“utf-8"?>
    <network-security-config>
    <debug-overrides>
    <trust-anchors>
    <!-- Trust user added CAs while debuggable only -->
    <certificates src=“user” />
    </trust-anchors>
    </debug-overrides>
    </network-security-config>
  4. Run your app in debug mode.

For more information on this procedure, see the official Android Developers documentation.

Configure the Device to Record Traffic

Once the above is done, follow the below steps to record traffic from your app or mobile browser:

On the left panel of the Proxy Recorder, you should be able to see all your proxy settings that you will need to enter in the following steps:

BlazeMeter_Recorder__9_.png

It’s now time to configure your Android device. Make sure your Wi-Fi connection is turned on.

  1. Go to your device’s "Settings", go to Connections, then "Wi-Fi", and hold selection on your local Wi-Fi network.
  2. Select the "Manage network settings" option and select "Show advanced options".
  3. Tap the Proxy dropdown and select "Manual" for the proxy setup.
    You’ll now be asked to enter data for the server and the port.
  4. Look at the proxy settings we provided earlier.
    1. For the server, enter the text displayed in the current proxy field.
      Don’t include the colon and port number at the end and don't include the "http://" prefix.
    2. Enter the port number in the ‘port’ field.
  5. Activate the "Authenticate server" option and enter the authentication username and password that are provided in the proxy setup.
  6. You may be prompted for the username and password when accessing the browser, so be prepared to enter this information again.
  7. Tap the "Save" button to save your changes as shown in the following screenshot:

    Screenshot_20180807-114712_Settings__1_.jpg

  8. Open your mobile browser and enter the following URL: http://mitm.it.
    You should see various devices, including Android and Apple, on your screen.
  9. Select Android.

    43909920160121-3-1debm4r.jpeg

    If you have an issue with the Android certificate, you can also use the Other certificate.
  10. Tap the Android option and download the certificate.
  11. When prompted, enter a name for the certificate (doesn't matter what the name is) and set the "Used for" to "VPN and Apps", and tap "OK":

    Screenshot_20180807-121847_Certificate_installer.jpg

  12. Turn off the Wi-Fi on your device, then turn it back on.
    This step recycles the connection to use the certificate.
  13. Next, go back to your Recorder window/tab, and click that big red button at the bottom of your screen.

Now you are ready to start recording your session.