Why Network Testing Matters for Mobile

Mobile users experience a wide range of network conditions that desktop users rarely encounter. A user might start a transaction on a fast WiFi connection, walk into an elevator (no signal), exit to a parking garage (weak cellular), and drive away (switching towers). Your app must handle all of these transitions gracefully.

Network Condition Categories

ConditionSpeedLatencyReal-World Scenario
No network0N/AAirplane mode, underground
2G (EDGE)50-200 Kbps300-1000msRural areas, developing countries
3G0.5-5 Mbps100-500msSuburban areas, older networks
4G LTE5-50 Mbps30-100msMost urban areas
5G50-1000+ Mbps1-10msSelect urban areas
Slow WiFi1-5 Mbps10-50msCrowded cafes, hotels, airports
Fast WiFi50-500 Mbps1-10msHome, office

Network Throttling Tools

Apple provides a built-in network throttling tool:

  1. On device: Settings > Developer > Network Link Conditioner
  2. In Xcode: Xcode > Open Developer Tool > Network Link Conditioner
  3. Preset profiles: 3G, Edge, WiFi (lossy), 100% Loss, etc.

Android Network Emulation

Android emulator has built-in network speed settings:

# Using ADB
adb shell svc wifi disable                    # Disable WiFi
adb shell settings put global airplane_mode_on 1  # Airplane mode

# Emulator command line options
emulator -avd Pixel_8 -netdelay edge -netspeed edge  # 2G simulation

Charles Proxy

Charles Proxy works with both iOS and Android:

Settings > Proxy > Throttle Settings
- Bandwidth: 50 Kbps (simulate 2G)
- Latency: 500ms (simulate poor connection)
- Stability: 80% (simulate packet loss)

Essential Network Test Scenarios

1. Slow Network Loading

Test every data-loading screen on 2G/3G speeds:

  • Loading indicators appear within 1 second
  • Content loads progressively (text before images)
  • Timeout errors are shown after reasonable wait (15-30 seconds)
  • User can cancel long-running operations
  • Previously cached data is shown while refreshing

2. Network Loss During Operation

Test losing network connectivity during:

  • Form submission → data preserved, retry after reconnection
  • File upload → resume or restart with clear feedback
  • Payment transaction → proper error handling, no double charges
  • Chat message sending → message queued, sent on reconnection
  • Video/audio streaming → buffer, resume, or graceful stop

3. Network Transitions

Test switching between network types:

  • WiFi to cellular (walk away from router)
  • Cellular to WiFi (arrive at home/office)
  • 4G to 3G to 2G (entering rural area)
  • Network to no network to network (tunnel or elevator)

4. Timeout Handling

OperationSuggested TimeoutError Behavior
API requests15-30 secondsRetry with backoff
Image loading10-20 secondsShow placeholder
File uploads60-120 secondsResume capability
WebSocket connection10 seconds + heartbeatReconnect automatically

Testing with Charles Proxy

Charles Proxy is the most versatile network testing tool for mobile:

Setup for iOS

  1. Install Charles on your Mac
  2. Configure iOS device WiFi proxy to your Mac’s IP, port 8888
  3. Install Charles root certificate on the iOS device
  4. Enable SSL Proxying for specific domains

Setup for Android

  1. Configure emulator/device proxy settings
  2. Install Charles certificate (may require network security config for Android 7+)
  3. Enable SSL Proxying

Key Charles Features for Testing

  • Throttling: Simulate any network speed/latency combination
  • Breakpoints: Pause specific requests to modify before sending
  • Map Remote: Redirect API calls to different servers
  • Rewrite: Modify request/response headers and bodies
  • Repeat: Replay requests to test idempotency

Advanced Network Testing Strategies

Testing Request Retry Logic

When a request fails due to network issues, apps typically retry. Test the retry mechanism:

Verify:
□ Exponential backoff between retries (1s, 2s, 4s, 8s...)
□ Maximum retry count (typically 3-5 retries)
□ User notification after final retry failure
□ Retry does not duplicate side effects (double payment, duplicate message)
□ Manual retry option available after automatic retries exhaust

Testing Bandwidth-Sensitive Features

Some features need special attention on slow networks:

FeatureSlow Network ImpactTest Strategy
Image galleriesExtremely slow loadingProgressive loading, thumbnails first
Video playbackBuffering, quality dropsAdaptive bitrate, quality selector
Real-time featuresDelayed updatesOptimistic UI, pending indicators
File downloadsTimeouts, partial downloadsResume capability, progress indicator

Testing SSL/TLS Certificate Handling

Use Charles Proxy to test certificate scenarios:

  • Valid certificate → connection succeeds
  • Expired certificate → warning or rejection
  • Self-signed certificate → strict rejection (no override)
  • Certificate pinning → verify pinned cert is validated

Exercise: Network Test Plan

Scenario: You are testing a messaging app. Design a network test plan covering:

  1. Sending a message on 2G
  2. Receiving messages while switching from WiFi to cellular
  3. Uploading a photo on a connection with 20% packet loss
  4. App behavior when the server returns a 503 (Service Unavailable)
Solution
  1. Sending on 2G: Use Charles Proxy throttle at 50Kbps/500ms latency. Verify: (a) Message shows “sending” state immediately; (b) Message transitions to “sent” after network delivery; (c) If sending takes >30s, show timeout with retry; (d) Draft preserved if app is backgrounded during send.

  2. WiFi to cellular during receive: Start on WiFi, switch to cellular mid-conversation. Verify: (a) No messages lost during transition; (b) New messages appear within 5s of transition; (c) WebSocket reconnects automatically; (d) No duplicate messages appear.

  3. Photo upload with packet loss: Configure Charles with 20% random failure. Verify: (a) Upload retries automatically on failure; (b) Progress bar reflects actual upload progress; (c) Upload can be cancelled; (d) On final failure, photo is saved locally for retry later.

  4. Server 503 response: Use Charles to return 503 for API calls. Verify: (a) User sees “service temporarily unavailable” message; (b) App retries after delay (not immediately); (c) Previously loaded messages remain visible; (d) Send queue holds messages until service recovers.

Pro Tips from Production Experience

Tip 1: Test the first load experience on 3G. Many users will first open your app on a mediocre connection. If the initial load takes more than 5 seconds on 3G, you will lose users before they even see your product.

Tip 2: Use Charles Proxy’s throttle presets for consistency. Create custom throttle presets for your most common test scenarios (e.g., “India 3G”: 384Kbps down, 128Kbps up, 250ms latency) and share them with your team.

Tip 3: Test the second-worst case, not the worst. 100% network failure is easy to test and usually well-handled. The tricky bugs appear at 80% packet loss, 2Kbps bandwidth, or 3000ms latency — conditions that are bad enough to break things but not obvious enough to trigger the offline mode.

Key Takeaways

  • Mobile users experience wildly varying network conditions — from 5G to no signal, often within minutes
  • Network throttling tools (Charles Proxy, Network Link Conditioner, ADB) are essential for realistic testing
  • Test loading states, timeouts, retry logic, and network transitions systematically
  • Special attention needed for payment transactions, file uploads, and real-time features during network issues
  • The most dangerous bugs appear during network transitions (WiFi to cellular) and degraded connections (not full disconnection)