Tharindu Kandegedara
Tharindu Kandegedara

Reputation: 91

Android 12 Mobile device http/https traffic is not recorded in Jmeter

Please find the steps I followed when recording the mobile device traffic

  1. Connect the Jmeter(version 5.5) installed lap top and the Mobile device (Samsung galaxy Android 12) in same wifi network (same subnet)
  2. Setup the lap top's ip address(ipconfg command) in mobile wifi settings as manual proxy.
  3. Setup the Jmeter setup port in mobile wifi settings as manual proxy - port.

Note - Traffic is allowed through mentioned port via Firewall (inbound rule)

enter image description here enter image description here

  1. click start button in jmeter's HTTP(S) Test Script Recorder.
  2. Import the jmeter CA certificate (generated in jmeter bin folder) in to mobile device.
  3. Install it through Settings >> Biometrics and security >> Other security settings >> Install from device storage >> CA certificate >> Accept the warning and install

enter image description here

  1. Login to browser from mobile and search any keyword(default samsung browser, cleared browser cache)
  2. Observe the results recording in jmeter result tree.

Observation - No any traffic from mobile is recorded.

below logs are recorded only in jmeter console

enter image description here

Please help to know the reason how this issue need to be resolved.

Upvotes: 0

Views: 419

Answers (2)

Tharindu Kandegedara
Tharindu Kandegedara

Reputation: 91

I found the solution by myself.

Solution:

Originally the network profile of my lap top was set as Public. see below.

enter image description here

Then I changed it to "Private". problem was resolved for me with that. Thanks.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168072

I don't think these steps are sufficient for Android 12, you need to additionally follow the steps from Network security configuration page of Android documentation in order to instruct your application to trust JMeter's CA certificate.

  • add the next line to the application section of your app manifest

    android:networkSecurityConfig="@xml/network_security_config"
    
  • create network_security_config.xml file under your app resources folder with the following content

    <?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>
    
  • build your app in debug mode

  • replace the app in the device with the debug .apk from the previous step

More information: Configure Android Devices for Proxy Recording

Upvotes: 1

Related Questions