0
votes

Installed Jmeter 5.3 on my Mac. I had set the HTTP(s) proxy to 8089. Installed Jmeter certificate on my pixel 2xl device. Configured the proxy with port. After proxy setup, unable to surf internet on my mobile. As a result unable to record Jmeter script.

1

1 Answers

0
votes
  1. Make sure that both devices are on the same subnet and you can i.e. ping mobile from laptop and vice versa
  2. Make sure that JMeter is listening to IPv4 interface and if this is not the case - add java.net.preferIPv4Stack=true line to system.properties file (lives in "bin" folder of your JMeter installation)
  3. Make sure that incoming connections to port 8089 are not blocked by your operating system firewall or other antivirus software
  4. If your device is running Android 7.0 or higher you need to take some extra steps to be able to record HTTPS traffic, in particular:

    • Add the next line to the application section of your Android application manifest file:

      android:networkSecurityConfig="@xml/network_security_config"
      
    • Create network_security_config.xml file under your application resources folder and put the following code inside:

      <?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>       
      
    • Compile and install your application in debug mode:

      gradlew installDebug
      

    More information: Recording Using Android Devices

If you don't have access to application sources you will have to root your device in order to be able to record traffic using JMeter by placing its certificate into Android OS trusted authorities storage