Search code examples
iphonecocoa-touchxcodeios4profiling

Tracking data size over network -- iPhone server communication


I want to log the number of bytes being transferred from my iPhone app to server so that I could put a watch on the bandwidth being eaten up and could take necessary actions.

How can I do this?


Solution

  • In Instruments there is Network Activity Monitor that does what you need. You can always correlate your findings with network usage numbers in your Settings.app on actual device. Settings->General->Usage

    Update: Second approach:

    1. Make sure you use cellular connection first
    2. Reset your data counter.
    3. Launch your app and perform operations that interested in
    4. Quit your app and see the traffic used in Settings.app

    On the picture below is traffic used for my app in 2 minutes. enter image description here