Network packet analysis is a debugging capability provided by HarmonyOS. You can install Wireshark on a Windows PC to analyze network packets from a device. Network communication debugging is a common requirement in mobile app development. The network packet analysis feature provides a plug-and-play solution: simply connect a phone or tablet to a PC via USB to capture network packets from the device on the PC. Typical use cases include debugging app network requests (such as HTTP, HTTPS, and WebSocket), analyzing network protocols (such as TCP and UDP), and troubleshooting network performance issues.
This feature is supported starting from 26.0.0.
After the device is connected via USB, the system automatically detects the device and creates an Ethernet adapter. No manual driver installation or complex configuration is required. Enable network packet analysis in Developer options to immediately view network packets in Wireshark.
With low latency, this feature is suitable for scenarios that require real-time observation of network requests, debugging of persistent WebSocket connections, or analysis of DNS resolution, enabling quick troubleshooting. Wireshark can also be used to export captured packets to a pcap file for further analysis.
| Status | Description | Operation |
|---|---|---|
| On | Network packets are being captured. | Can be manually turned off. |
| Off | Network packets are not being captured. | Can be turned on after a USB connection is established. |
| Unavailable (grayed out) | USB is not connected, and the feature cannot be used. | Can be turned on after USB is connected. |
Step 1: Access Developer options
When using this feature for the first time, follow Enabling Developer Options to enable Developer mode on the device. Then go to Settings > System > Developer options.
Step 2: Connect the device via USB
If the network packet analysis switch in Developer options is grayed out (unavailable), check whether the USB connection is working properly.
Step 3: Enable network packet analysis

Step 1: Identify the Ethernet adapter

If the newly added Ethernet adapter is not displayed, check the following:
Step 2: Start packet capture

Step 3: Interpret the captured packets
The packet capture window consists mainly of three areas:
| Area | Description |
|---|---|
| Packet list | Displays an overview of all captured packets. |
| Packet details: | Displays detailed protocol information about the selected packet. |
| Packet bytes | Displays the raw byte data of the selected packet. |
The columns in the packet list are described below:
| Column | Description |
|---|---|
| No. | Packet sequence number. |
| Time | Relative time elapsed since packet capture started. |
| Source | Source address (IP or MAC address). |
| Destination | Destination address (IP or MAC address). |
| Protocol | Protocol type, such as TCP, UDP, or HTTP. |
| Length | Packet length, in bytes. |
| Info | Basic packet information. |
Wireshark uses colors to distinguish different types of packets:
| Color | Description | Example |
|---|---|---|
| Green | Normal TCP traffic | Data transmission |
| Dark blue | TCP control packets | SYN, FIN, ACK |
| Light blue | UDP traffic | DNS queries, QUIC |
| Yellow | Warnings or anomalies | TCP retransmissions, out-of-order packets |
| Red | Errors or anomalies | TCP errors, checksum errors |
| Black | Malformed packets | Corrupted packets |
For more information about network packet analysis in Wireshark, see the Wireshark official website or other publicly available resources.
Step 4: Set filters (optional)
To reduce irrelevant traffic, use filters as needed:
| Filter | Description | Example |
|---|---|---|
| By protocol | Displays only packets of a specific protocol. | tcp, udp, http |
| By IP address | Displays only packets related to a specific IP address. | ip.addr == 192.168.1.100 |
| By port | Displays only packets on a specific port. | tcp.port == 8080 |
| Combined | Combines multiple filter conditions. | tcp and ip.addr == 192.168.1.100 |
Step 5: Stop packet capture and save the results

Method 1: Use the switch
If you enable the feature again after disabling it, close the current packet capture window in Wireshark on the PC, select the newly added Ethernet adapter again, and restart packet capture.
Method 2: Disconnect USB
Disconnect the phone or tablet from USB. Network packet analysis is automatically disabled.
Symptom
The network packet analysis switch in Developer options is grayed out and cannot be used.
Possible causes
The USB connection is unavailable or unstable.
Solution
Symptom
Network packet analysis is enabled on the Phone or Tablet, but no new Ethernet adapter appears in the Wireshark network adapter list.
Solution

Symptom
Packet capture has started, but no packets or very few packets are captured.
Possible causes
There is no actual network traffic on the phone or tablet.
The Wireshark filter is too restrictive, for example, it limits traffic to a specific IP address or port.
Solution

Symptom
Network packet capture stops unexpectedly.
Possible causes
USB debugging or USB tethering is enabled during network packet capture.
The USB connection is unstable. If the USB connection is unexpectedly disconnected and then restored, network packet analysis must be manually re-enabled.
Wireshark encounters an error.
Solution
Symptom
The device heats up after network packet analysis is enabled.
Solution
It is normal for the phone or tablet to generate more heat while this feature is enabled. Disable network packet analysis promptly after debugging is complete.