Ricardo Gomes
Ricardo Gomes

Reputation: 140

iOS Swift capture network packets

For a testing App i need to get network information from iOS. In Android there are API's available to obtain packets sent, received, size of them in bytes, and some other information. Is there anything similar in Apple iOS?

More deep information obtained with pcap C library can be used without Jailbreak?

Upvotes: 3

Views: 1655

Answers (1)

user862787
user862787

Reputation:

More deep information obtained with pcap C library can be used without Jailbreak?

Not by running a libpcap-based program on iOS, because Darwin, by default, makes the BPF devices openable only by root, so, on {OS X, iOS, tvOS} only a process running with root privileges can use libpcap to capture network traffic; without jailbreaking, you can't run a program as root on iOS (or tvOS).

However, with iOS 5 or later, you can use the remote virtual interface facility in iOS and OS X to let a program running on a Mac see the traffic received and sent by an iOS machine.

Upvotes: 4

Related Questions