Collect har file and pcap from mobile phone (iOS/Android)
search cancel

Collect har file and pcap from mobile phone (iOS/Android)

book

Article ID: 432052

calendar_today

Updated On:

Products

Cloud Secure Web Gateway - Cloud SWG

Issue/Introduction

Mobile phones apps have limited functionality and the browsers (chrome, safari etc) do not offer launching Developer Tools and collecting har file.

Also, there is not a mobile app which could collect pcap on the phone itself.

Getting the above logs is necessary for troubleshooting e.g. SEP Mobile connectivity via Cloud SWG, or SAML configuration issues

Environment

Android / iOS (iPhone) mobile phones

Resolution

PCAP

In order to take pcap from the mobile phone:

 

HAR file

Steps to be followed when taking har file from Android device:

  • Go to Settings and ensure Developer Options are visible at the very bottom. If not, go to "About Phone", find the Build number and tap on it 7 times.
  • Now go to "Developer Options" and enable "USB Debugging option"
  • Download the https://developer.android.com/tools/releases/platform-tools and unzip it. The "adb.exe" tool is needed for that debugging
  • Go to the unzipped folder, in the address bar type "cmd" and hit enter. This will open command line window with the path to the adb.exe tool location.
  • to ensure that adb tool is listening properly, enter the following command:
    adb start-server
    this output will confirm the listening is on and the tool is ready to get the data from mobile phone:
    platform-tools>adb start-server

    * daemon not running; starting now at tcp:5037

    * daemon started successfully
  • Open new chrome tab and go to: chrome://inspect/#devices
  • Connect mobile phone with USB cable to the computer.
  • Once connected, the following prompt will appear on the phone:
    Allow USB debuggin?
    The computer's RSA key fingeprint is:
    <HEX string>
    Always allow from this computer

  • Allow that selecting "always allow"
  • On the computer check the chrome://inspect/#devices. The mobile phone name will appear on the page and will display any chrome tabs (if opened).
  • Once located the proper tab, click on "inspect". It will open separate window.
    Ensure that both "Preserve log" and "Disable cache" are enabled and reopen the failing website. It can be done from the computer now, as the mobile output will be displayed there.
  • Once the issue is reproduced, save the har file, disconnect the mobile from USB, disable USB debugging, and turn off Developer Options" if troubleshooting is completed.

Steps to be followed when taking har file from iOS device (iPhone):

  • Download the https://inspect.dev/ tool (not paid version, free tools is enough).
    • It will be required to login to the tool.
    • The application needs to be installed on the machine
  • Once the application is executed, select iOS platform and then download necessary Apple Devices (link is available within the tool)
  • Connect iOS device via USB and confirm trust on iPhone.
  • The tool will display iPhone name and the opened tabs. Start inspecting the necessary tab. Ensure that both "Preserve log" and "Disable cache" are enabled and reopen the failing website.
  • Once the issue is reproduced, save the har file, disconnect the mobile from USB