简体   繁体   English

苹果是否允许在iPhone应用中使用tcpdump

[英]Does apple allow to use tcpdump for use in iPhone app

I'm planning to use tcpdump for development of an iPhone app. 我打算使用tcpdump开发iPhone应用程序。 But i'm not sure will Apple allow it or not with iOS 8.0 onwards to be used in iPhone app development. 但是我不确定苹果是否允许iOS 8.0或更高版本在iPhone应用程序开发中使用。

Please provide your comments on this 请提供您对此的评论

Thanks 谢谢

You won't be able to open a BPF device on iOS - by default, XNU creates BPF devices with permissions rw-------, owned by root, so even if a process running in a sandbox (which all non-Apple iOS applications - and probably most Apple iOS applications - on a non-jailbroken iOS machine are) is allowed to open files in /dev , your program won't be able to capture network traffic. 您将无法打开BPF设备上的iOS -默认情况下,XNU创建具有权限RW ------- BPF设备,由root用户拥有,因此, 即使一个进程在沙箱中运行(所有非允许在非越狱的iOS机器上的Apple iOS应用程序(可能还有大多数Apple iOS应用程序)打开/dev文件,您的程序将无法捕获网络流量。

I also think sandboxed applications may not be allowed to fork and exec or posix_spawn() arbitrary programs, so your application probably wouldn't be able to run tcpdump as a program - assuming it's even shipped with iOS, which it might not be. 我还认为,可能不允许沙盒化应用程序派生和执行或posix_spawn()任意程序,因此您的应用程序可能无法将tcpdump作为程序运行-假设它甚至随iOS一起提供,但可能不是。

You might be able to incorporate tcpdump code in your application, but without being able to capture traffic, all it will be able to do is to read existing captures, and that's probably easier to do on your Mac. 您可能可以将tcpdump代码合并到您的应用程序中,但是如果无法捕获流量,则只能读取现有的捕获内容,这在Mac上可能更容易做到。

So this is probably a project of interest only on a jailbroken machine. 因此,这可能只是在越狱机器上感兴趣的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM