1

I want to capture the iPhone's network traffic. Will Apple allow us to do this? Are there any APIs for the developer to monitor the signals?

ljs.dev
  • 4,449
  • 3
  • 47
  • 80
Magic fish
  • 78
  • 11

2 Answers2

1

If by "flow" you mean all the data being sent and received by those mechanisms, then no - you can't do this on a non-jailbroken iPhone. Apps are restricted from interfering with anything the system processes or other applications do.

Adam Wright
  • 48,938
  • 12
  • 131
  • 152
  • I see some Apps can do this in itunes store? That means, Apple allow developer to do this or the app using other method to monitor it? – Magic fish Nov 04 '11 at 01:19
  • http://itunes.apple.com/cn/app/id425315731?mt=8 http://itunes.apple.com/cn/app/id432905116?mt=8 And,I find some info about this, http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring I don't know whether it work well? – Magic fish Nov 05 '11 at 02:25
  • Ah, these are getting the total number of packets going through each interface, from which you can estimate a data usage level. That other question is a good answer to that, if that's your problem. – Adam Wright Nov 05 '11 at 11:52
  • The answer is very good. But ,it only getting the total number of packets going through each interface. Can I get every App's data? And,the data is reset when user reboot his iphone. – Magic fish Nov 07 '11 at 07:29
  • No, you can't. As per my answer – Adam Wright Nov 07 '11 at 13:10
0

If you want to capture IP traffic, and your iPhone is running iOS 5 or later, and you can hook your iPhone up to a machine running OS X, you can use the remote virtual interface mechanism, which funnels a copy of the network traffic to the Mac to be captured with your favorite network tool (tcpdump, Wireshark, etc.).

If you want to capture traffic at a lower level, you could capture Wi-Fi traffic with a Wi-Fi adapter in monitor mode (but be prepared to have to decrypt the traffic; see the Wireshark "how to decrypt 802.11" page for information on that), but you will have extreme difficulty capturing raw mobile-phone-network traffic (you probably won't be able to).