Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Simulator - Simulate a slow connection?

People also ask

How do I simulate a slow Network on my iPhone?

iPhone Device. Go to your Settings and go to Developer menu. Like the Network Link Conditioner in macOS, you can choose a desired profile to simulate for example a poor connection (100% Loss), or a 3G connection and so on.

How do I throttle Internet speed on iPhone?

Go to Settings and tap Wi-Fi. Tap the Info button next to the Wi-Fi network that you're connected to. Turn on Low Data Mode.

Does iOS simulator simulate performance?

The simulator does a really lousy job of indicating app performance. In fact it doesn't try. For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory.


How to install Apple’s Network Link Conditioner

These instructions current as of October 2019.

Warning: If you just upgraded to new version of macOS, make sure you install the very latest Network Conditioner (in Additional Tools for Xcode) or it may silently fail; that is, you will turn it on but it won’t throttle anything or drop any packets.

Update: As of Xcode 11, there may be an even simpler way to simulate network conditions on tethered devices; see this blog post. For how to affect simulated devices, continue below, as before.

  1. Install Xcode if you don’t have it.

  2. Open Xcode and go to Xcode › Open Developer Tool › More Developer Tools…

Screen shot of navigating the menu as described

  1. Download Additional Tools for Xcode (matching your current Xcode version)

Additional IO Tools download link

  1. Open the downloaded disk image and double-click the Network Link Conditioner .prefpane under “Hardware” to install it.

pref pane in DMG

system preferences showing installation prompt

  1. There we go!

Screen shot of the preference pane

  1. Be sure to turn it on. You need to select a profile and enable the network conditioner.

enter image description here

Caveat

This won't affect localhost, so be sure to use a staging server or co-worker's computer to simulate slow network connections to an API you’re running yourself. You may find https://ngrok.com/ helpful in this regard.


"There's an app for that!" ;) Apple provides "Network Link Conditioner" preference pane that does the job quite well.

  • for Xcode versions prior to 4.3, the pane installer can be found in your Developer folder, e.g. "/Developer/Applications/Utilities/Network Link Conditioner", after installation, if daemon fails to start and you don't want to reboot your machine, just use sudo launchctl load /system/library/launchdaemons/com.apple.networklinkconditioner.plist
  • if you are already done with Developer folder, you can install the pane as a part of "Hardware IO Tools for Xcode" package available via Mac Dev Center additional downloads section.

Link to download page (you must log in with your Apple ID): https://developer.apple.com/downloads/index.action
(credits to @nverinaud)


An app called SpeedLimit

https://github.com/mschrag/speedlimit

Works great.

chris.


It also worth mentioning that Xcode also has a built in way for devices, not simulator.

  • Just go 'Devices and Simulator' (cmmd+shift+2)
  • Select your device
  • Scroll down til you find 'Device Conditions'
  • Set your desired profile
  • Hit Start

enter image description here

To have this working you need to install 'Network Link Conditioner' on your Mac. See steps mention in Alan's answer