Is there an iOS-compatible Objective-C-port of the tcpdump
C-sources or a working tcpdump
binary for iOS? And if so, does it capture the traffic from all network devices? Or does it capture only an Ethernet device? Is there libpcap
for iOS? I am aware, that this requires a jailbroken Phone.
Asked
Active
Viewed 3,104 times
3

Sebastian
- 905
- 2
- 9
- 21
1 Answers
3
Yes to both:
http://planet-iphones.com/cydia/id/tcpdump
http://planet-iphones.com/cydia/id/libpcap
However I don't understand why you want an Objective-C port?

trojanfoe
- 120,358
- 21
- 212
- 242
-
i asked for a objective-c port because i wanted to build it into a gui app. and calling plain c code from obj-c code would halt the event loop, wouln't it? what would actually be better practice: call the commandline tool and intercept its output or have tcpdump built into the gui app? – Sebastian Nov 15 '12 at 10:11
-
on the iPhone 4 of a friend, tcpdump does not show up in the repository. i do no longer have access to his phone, so i can not check if the executable (manually downloaded) can be ran on his device. do you know, whether the binary is compatible with iPhone 4 / 5 CPU Architecture? – Sebastian Nov 15 '12 at 10:22
-
@Sebastian My iPhone 4 Cydia shows `tcpdump` within search, however I cannot access the package over 3G and am not near a usable Wifi. So it looks like it's supported (and there is no reason to suppose the iPhone 4 CPU does not support everything). – trojanfoe Nov 15 '12 at 10:36
-
1@Sebastian, unless I'm misunderstanding you, **no**, calling C code from Objective-C doesn't halt the event loop. Lots of the normal, public iOS APIs are actually C APIs. They don't halt the event loop. I can understand why you don't want to have to run a command line process and capture output, but C vs. Objective-C shouldn't be a problem. – Nate Nov 15 '12 at 14:55
-
Thank you both for your help. i will get access to a phone next week and then try it out. – Sebastian Nov 20 '12 at 14:06