Does apple allow to use tcpdump for use in iPhone app - ios

I'm planning to use tcpdump for development of an iPhone app.
But i'm not sure will Apple allow it or not with iOS 8.0 onwards to be used in iPhone app development.
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.
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.
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.
So this is probably a project of interest only on a jailbroken machine.

Related

What shell commands can you access on iOS via the "system" command in Objective-C?

I know that both Mac OS and iOS are based on Darwin OS. Does this mean all the OS X commands available in Terminal are available on iOS using the "system" command in Objective-C? If not, which ones are?
No, there is no shell available on an un-jailbroken iOS, and hence system() doesn't do anything useful. Adding a shell is apparently a common thing to do on jailbroken devices.
Most of the user-mode C/C++ run-time library is available in modern versions of iOS (I haven't worked with versions older than 9) so quite a lot of classical UNIX code can work. Writing an app with a shell user interface should be possible, but it isn't very useful without jailbreaking, for at least two reasons:
An app only has access to its own directory hierarchy, and thus can't see other apps' files.
iOS apps are not designed to be administered via a command-line interface.
I suspect Apple would also reject any submission of a command-line app to the App Store.

Writing device drivers for iOS

I have a high level question I seek information on:
Is it possible to write a device driver in iOS ? Is it possible to write a driver & deploy it to my iPhone or iPad ?
If yes, then are the drivers advised to be written in language Swift ? Or is c ?
Short answer, no.
I'm not really sure what you're trying to do, so more details may be helpful, but by the sound of it, no you can't write and deploy device drivers on iOS.
iOS is tightly locked down by Apple. Each app lives in its own sandbox in an effort to keep the system secure. You have access to the public APIs. Accessing private APIs may result in your app being rejected from the review process.
In order to write and install device drivers for iOS devices you would need to get support from Apple. There are various types of drivers depending on what it is you want to do. They have a program for vendors who make accessories that plug into the lightning port (or the older 30-pin port) and another program for manufacturers of Bluetooth devices. Both require licenses from Apple.
I'm not sure what other types of device drivers are possible. You need to be more specific.

Possible to Run iOS Apps on PC

Is it possible to run iOS Apps DIRECTLY on Mac OS? What about Windows? Or do you always have to use a virtual machine? I searched around and all I found was people saying you need to use a virtual machine. Reason for this: I want to automate behavior on an app on my iphone, and I think that will be much faster on my PC.
The iOS SDK accesses the hardware of the iPhone/iPad. It's very specific hardware which is not available on any other device.
The CPU is different, the display, device buttons, sensors and phone specific stuff...
The simulator simulates all this hardware, still it needs a different compile and can not execute the iOS bundle as it does not simulate the Arm CPU architecture.
That said, it does not make much sense to do automated test on another platform than the target platform, as the app might have slightly different errors and behavior.

Does iOS 8.3 now support Wifi debugging?

I updated iOS on my phone to 8.3 and I saw this message popup on first boot, but I have not seen it since:
I have been searching all day for information and I can't find a single reference to this message or to Xcode supporting wifi debug.
I am using a macbook pro 2009 model, and I have read that this is not compatible with the new continuity features (as well as airdrop etc). I am wondering if this is part of the wifi debug (and also if BTLE is involved at all). Of course it is all speculation since I cannot find any documentation about this.
Has anybody used wifi debug, or can point me to any documentation?
No, the feature was disabled as it causes serious security flows, for example when debugging you can fake location for any app, access confidential data like your number, udid etc. WiFi can be used now only to sync using iTunes.
It's restricted to USB only. You would need to write a bridge between USB and WiFi. You could in theory connect iPhone to Raspberry Pi, use open source crossplatform libMobileDevice. And mirror all USB requests from your XCode to this device USB.

Virtualization of iOS

I am interested in analyzing the network traffic utilized by an app I found on the app store. I could just use wireshark to analyze the traffic on the network, but that would be too easy.
Instead, I would rather run the app on a virtualized instance of iOS.
Is it possible to run iOS in a virtual machine on OS X?
My initial search shows that this may be difficult because a lot of virtualization software is designed for the x86 architecture, and iOS runs on ARM architecture.
Has anybody gotten this to work before?
As you said, you cannot run regular Appstore apps on Simulator.
Instead, use jailbroken iDevice, install from Cydia tools like tcpdump, sslKillSwitch to monitor phone device traffic.
Other tricks you can find on IOS app analysis website
Good luck!
It is not possible to install iOS on VirtualBox because iOS is only for ARM-based processors, and VirtualBox does not support hardware emulation of the ARM architecture. Unlike Android, iOS isn't open source so you can't recompile it for x86 processors. Plus, you'd need to write a custom boot loader for iOS somehow.
A company called Corellium is claiming to be the first business to offer a virtualized iOS device experience to developers and testers. The company is defining this as the "future of mobile development" which will give developers instant access to run their creations on virtualized iPhones and iPads on a Mac or PC which are running actual real versions of iOS.

Resources