Is there a way to limit processing power and network bandwidth for iPhone Simulator?
This question is essentially a CPU and bandwidth limiting tool for specific program on Unix. Any recommendations...?
Is there a way to limit processing power and network bandwidth for iPhone Simulator?
This question is essentially a CPU and bandwidth limiting tool for specific program on Unix. Any recommendations...?
As for network/bandwidth limitations, there's a really good tool called Network Link Conditioner included with XCode nowadays. Possible to use a number of presets as well as setting up your own configurations.
You can also check out: How do I simulate a slow internet connection (Edge/3g) on a mac. Is there a Firefox plugin?
UPDATE: Note that the Network Link Conditioner (as of iOS6) is available from the Settings > Developer menu on your iPhone (if it's marked as Use for development).
To limit your bandwidth, you can try using http://mschrag.github.com/. It's a preference pane which helps you simulate several bandwidth configurations (Edge, 3G, etc).
You could use the osx firewall to do this :
sudo ipfw add 1 pipe 1 ip from any to me src-port 80
sudo ipfw pipe 1 config bw 40KByte/s
Edit : it seems that the simulator use local ipv6 address, and ip6fw doesn't manage pipe and bandwidth limit. I've edited my code to be sure that localhost v4 (127.0.0.1) address is used.
You could try using nice: http://unixhelp.ed.ac.uk/CGI/man-cgi?nice
At least that will help with the CPU problem.
You can use cpulimit to limit the CPU usage in term of percentage.
UPDATE: Read this discussion to know how to configure iptables to limit bandwidth per process.