【问题标题】:Issue: Android Mobile Native Application Recording issue问题:Android 移动原生应用程序录制问题
【发布时间】:2020-05-03 13:49:09
【问题描述】:

Android 移动原生应用录制问题

  • 第 1 步:笔记本电脑和 Android 手机在同一个 wifi 网络上。
  • 第二步:Android手机配置如下:
  • 手动:IP 设置为笔记本电脑 (IP4),端口设置为 JMeter 端口 8888
  • 第 3 步:开始录制
  • 第 4 步:开始在 Android 原生应用程序上执行操作。

观察:

  • 原生应用录制失败。

附加信息:我可以在 Android 网络浏览器上记录操作

【问题讨论】:

    标签: android jmeter native


    【解决方案1】:

    如果您正在运行 Android 7.0 或更高版本,很可能是 increased network security config 的问题,因此您需要 follow some extra steps in order to be able to record secure traffic using JMeter proxy server,即:

    1. 将下一行添加到Android app manifest 文件的application 部分:

      android:networkSecurityConfig="@xml/network_security_config"
      
    2. 在您的app resources 文件夹下创建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>
      
    3. Compile and install your application in debug mode点赞:

      gradlew installDebug
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-02
      • 2017-06-11
      • 1970-01-01
      • 2011-07-11
      • 2016-08-04
      • 2017-01-28
      • 2016-06-22
      • 1970-01-01
      相关资源
      最近更新 更多