Install Apple's Network Link Conditioner (NLC) from the Additional Tools for Xcode package, switch on the Very Bad Network preset, and confirm your URLSession retry and timeout logic fires in the iOS Simulator. NLC is a macOS preference pane that throttles the host network stack with configurable bandwidth, latency and packet-loss settings. The Simulator uses the Mac's network, so every profile you apply affects it too, with no device cables or provisioning profiles.
Where do I find Network Link Conditioner?
In the Additional Tools for Xcode package on Apple's developer downloads site, not in Xcode itself.
- In Xcode, pick Xcode → Open Developer Tool → More Developer Tools…. That opens the Apple developer downloads page (sign in with your Apple ID).
- Search for Additional Tools for Xcode and pick the version matching your installed Xcode.
- Mount the
.dmgand open the Hardware folder. Inside isNetwork Link Conditioner.prefPane.
The download page works the same in Safari on the remote Mac, where you stay signed in to the Apple developer portal.
How do I install the preference pane on the remote Mac?
Open an encrypted remote desktop session to the Mac, then double-click the pane.
- Open the mounted Hardware folder in Finder.
- Double-click Network Link Conditioner.prefPane. macOS asks whether to install for the current user or all users; pick the option that matches how you run the Simulator.
- Open System Settings → Network Link Conditioner (macOS Ventura and later) or System Preferences → Network Link Conditioner on older macOS. The pane appears at the bottom of the window.
If the pane does not appear, remove any stale copy from ~/Library/PreferencePanes/ and reinstall. On newer macOS versions Apple occasionally gates third-party panes behind Privacy & Security; approve it once and reopen System Settings.
What do the built-in presets simulate?
Five presets ship with NLC. Read the exact numbers from the pane on your installed macOS, because Apple has adjusted the defaults between releases, and treat this table as a real-world mapping rather than a spec sheet:
| Preset | Approx. down / up BW | Loss | Approx. delay | Real-world scenario |
|---|---|---|---|---|
| Edge | 240 / 200 Kbps | 0% | 400 / 440 ms | Rural 2G fallback |
| 3G | 780 / 330 Kbps | 0% | ~100 ms | Indoor 3G cell signal |
| LTE | ~50 / 50 Mbps | 0% | ~65 / 50 ms | Clean LTE outdoors |
| Very Bad Network | ~1 / 1 Mbps | ~10% | ~500 ms | Congested café Wi-Fi |
| 100% Loss | — | 100% | — | Airplane mode / dead zone |
A preset takes effect on every connection the Mac makes, including your remote desktop session. If the session starts lagging, switch to LTE or turn NLC off before navigating the desktop, then re-enable the target preset just before the test run.
How do I create a custom profile?
Click Manage Profiles… (or +, depending on the macOS version) and set values your production telemetry actually shows:
- Downlink / uplink bandwidth. Mobile upload is usually much slower than download, so set them independently.
- Downlink / uplink packet drop. Percentages. 2 to 5% is a loaded cell; 10% or more is a failing link.
- Downlink / uplink delay. One-way latency in milliseconds.
- DNS delay. A fixed penalty per lookup. Useful for finding apps that make repeated DNS calls instead of caching.
A realistic "roaming abroad" profile: 1 Mbps down, 512 Kbps up, 5% loss, 350 ms each way, 200 ms DNS delay.
How do I check the app reacts correctly?
Run the app in the Simulator with a preset enabled and exercise one real network path. The example below is an untested sketch. Copy it into your own test target, point it at an endpoint you control, and run it twice (NLC off, NLC Very Bad Network) to compare elapsed times and error paths:
import XCTest
final class NetworkConditionTest: XCTestCase {
func testTimeoutAndRetryFire() async throws {
// Use an endpoint you own; httpbin is illustrative only.
let url = URL(string: "https://example.invalid/api/ping")!
var request = URLRequest(url: url, timeoutInterval: 3.0)
request.httpMethod = "GET"
let start = Date()
do {
let (_, response) = try await URLSession.shared.data(for: request)
let code = (response as? HTTPURLResponse)?.statusCode ?? -1
print("ok status=\(code) elapsed=\(Date().timeIntervalSince(start))")
} catch {
// A timeout or NSURLErrorNetworkConnectionLost is the expected
// branch under Very Bad Network. Assert your retry layer was
// invoked (e.g. via an injected mock), not just that time passed.
print("error=\(error) elapsed=\(Date().timeIntervalSince(start))")
throw error
}
}
}
Two rules for this kind of test:
- A failed build or failed request is not a performance data point. Compare successful responses to successful responses, and let the test fail when the network path fails.
- Assert on your own retry layer's behavior (a counter, an injected mock, a log) rather than on elapsed wall time. Wall time under throttling is noisy.
How do I turn it off and verify?
Open System Settings → Network Link Conditioner, toggle OFF, then re-run a single request without a timeout guard and confirm normal latency. NLC stays on across reboots, so leaving Edge or 100% Loss enabled makes your next xcodebuild, brew or CI agent heartbeat crawl.
Use only a documented control method for the installed conditioner. networksetup and scutil do not by themselves select Network Link Conditioner profiles. Restore the prior state after the test and verify connectivity. A shell trap helps on normal exits but cannot recover from every process or machine failure.
Where can the Simulator and the Network Link Conditioner pane run?
NLC needs the desktop, so connect to the Mac desktop. The Intel Mac VM ($25 a month, $2 a day) runs macOS Sequoia and fits Xcode 26.3 or earlier, which is enough to host the Simulator and the NLC pane. Choose the Apple Silicon Mac VM ($39 a month, $6 a day, 4GB RAM) for Xcode 26.4 or later. A short throttling session also suits a day rental.
Related guides: