Some time ago I had to debug web portal which wasn't developed for the iOS but I had to test it on the iPad.

What is difficult? - you may want to ask. Just use Safari browser and attach debugger to device. But way for get this achievement was more sophisticated than simple attaching debugger. I had complex environment of web portal which can works only when I used certain ip-address and port. These configurations I usually add to hosts file like: 127.0.0.1 galacoral.local.

Solution as that will be seen isn't hard to find but if you don't have some part of knowledge you have to read manuals for software which I used (I mean software: Squid).



Welcome aboard and let's start.

We want to use a proxy server which called Squid and if you happy owner of OSX then you can use software Squidman
If you have other OS (Linux, Windows) then you must find a GUI for Squid or tune squid thought using config files.

Open a GUI software or go to config files and do like:


1. Put port which will correspond to our proxy server.





2. Add ip-addresses of clients which can connect to or proxy server. 
(I added all range of ip-addresses which are in my local network)





3. Also you have to add some rules to configuration files
( I used next rules:
acl Safe_ports port 8082 # http
acl Safe_ports port 8080 # http)






And other very important rule it's allowing to serve local addresses of host machine (it's where you installed proxy server) you have to remove disallowing from parameter
http_access allow to_localhost (just add allow instead of deny)





4. Learn ip-address which you have on host machine (it's where you installed proxy server) (I used ifconfig - last row) (on Windows this command is ipconfig /all)






5. Go to iDevice (iOS) and tune ip-address and port according with Squid proxy server.






6. Testing - put address which you use to access to local environment  (as I already said I added this address to host file)





7.  If you tuned  all correct, you see local env (Now you can attach Safari debugger to device)




P.S. This solution works for all platform (Android, Windows mobile, BlackBerry)