When debugging networks on macOS, packet capture is usually the first step.
For example:
- App fails to request an API
- An API returns abnormal data
- Need to confirm parameters sent by the client
For these issues, relying solely on code logs makes it difficult to judge network behavior; packet capture allows direct viewing of requests and responses.
Below, through a debugging process, several common methods for packet capture on Mac are introduced.
1. First, Capture Network Requests from the Mac Itself
If you need to view network requests from programs on the Mac itself, such as:
- Browser accessing APIs
- Desktop applications calling interfaces
The simplest method is to use proxy packet capture tools, such as:
- Charles
- Proxyman
- SniffMaster
These tools run locally and intercept requests via proxy.
Configuring Proxy Packet Capture
Steps are as follows:
- Start Charles or SniffMaster on Mac
- Check the proxy listening port, e.g., 8888
- Enable system proxy in macOS network settings
- Set HTTP and HTTPS proxy to the local address
- Save settings
Once done, local network requests will first pass through the proxy tool.
Installing HTTPS Certificates
If requests use HTTPS, you need to install proxy certificates.
Steps:
- Access the certificate address provided by the proxy tool in a browser
- Download the certificate
- Install the certificate in macOS Keychain
- Set the certificate to Always Trust
Once done, the proxy tool can decrypt HTTPS requests.
Verifying Successful Packet Capture
Open a browser and visit an HTTPS website.
If request records appear in the proxy tool and response content can be viewed, the packet capture environment is established.
2. Capturing iPhone Network Requests on Mac
If you need to debug network behavior of an iOS App, you can route iPhone traffic through the Mac.
The common method is still proxy packet capture.
Setting Up iPhone Proxy
Steps:
- Connect iPhone and Mac to the same Wi-Fi
- Open iPhone Settings → Wi-Fi
- Tap the current network
- Under HTTP Proxy, select Manual
- Enter the Mac's IP address
- Enter the proxy port (e.g., 8888)
Save and return to the home screen.
Installing iOS HTTPS Certificates
In iPhone Safari, access the certificate address provided by the proxy tool:
- Download the profile
- Install the certificate
- Enable certificate trust in iOS Settings
Once done, the proxy tool can decrypt iOS HTTPS requests.
Testing App Network Requests
Open the App and trigger network operations, such as:
- Login
- Loading a list
- Submitting a form
In the proxy tool, you can see:
- Request URL
- Headers
- Request body
- Response content
3. When Proxy Fails to Capture App Requests
Sometimes, this situation occurs:
- Safari requests can be captured
- App requests have no records
This indicates the App is not using the system proxy.
In this case, further adjusting proxy settings won't change the outcome.
Device-level packet capture is needed.
4. Using Device-Level Packet Capture Tools on Mac
Device-level packet capture directly reads network data from the device side.
In this scenario, you can use SniffMaster.
Using SniffMaster to Capture iOS Traffic
Steps:
- Connect iPhone to Mac via USB
- Keep the device unlocked
- Tap Trust This Computer on the phone
- Launch SniffMaster
- Select iPhone from the device list
- Follow prompts to install the profile
- Enter HTTPS Brute Force Capture Mode
- Click Start
Then trigger network requests on the phone.
Corresponding HTTPS requests will appear in the capture interface.

Viewing Only a Specific App's Traffic
Device-level capture includes system network traffic, such as:
- DNS requests
- Apple service connections
To more easily locate target requests, you can:
- Click Select App
- Check the target application
- Trigger network operations again
The capture list will only show that App's requests.

5. Analyzing TCP or UDP Network Issues
If debugging involves network connection issues, such as:
- Request latency
- Connection drops
- Packet loss
Data flow packet capture can be used.
SniffMaster supports capturing:
- TCP data streams
- UDP data streams
After capture, data can be exported to Wireshark for analysis.
In Wireshark, you can view:
- TCP three-way handshake
- Data retransmissions
- Connection closure reasons
6. Use Cases for Different Packet Capture Tools
In network packet capture, different tools serve different purposes:
| Tool | Capture Method | Main Use Case |
| ------------ | ---------------- | ---------------------- |
| Charles | Proxy Capture | HTTP / HTTPS Debugging |
| Proxyman | Proxy Capture | HTTPS Debugging |
| SniffMaster | Device-Level Capture | iOS Network Data |
| Wireshark | Network Layer Capture | TCP / UDP Analysis |
When debugging networks on Mac, you can follow this sequence:
- Use proxy capture tools to view HTTP / HTTPS requests
- If proxy fails to capture requests, use SniffMaster for device-level capture
- If network connection analysis is needed, export data to Wireshark
This approach covers most packet capture scenarios.
Reference link: https://www.sniffmaster.net/

Top comments (0)