In an automated test environment, I have to use 7.5GB of test data, that consists of 170k+ files. Simply copying it with the bundle is too slow (40+ minutes), thus I would like to incrementally sync the contents of the test data folder between the iOS device and the mac. Eg. using the iOS device as a USB drive, and use rsync to sync the contents, but any ideas are welcome. No, I can't jailbreak the device. Basically I want to keep two folders synchronized between an iOS test suite and a mac. Any ideas?
There is a way to do that using USB without jailbreaking your iOS device. The whole setup works via a UNIX socket called usbmuxd that Apple uses to communicate between a USB iOS device and e.g. Xcode or iTunes on a Mac. The iOS device basically opens a TCP server and the OSX app connects to the UNIX socket from which it can obtain a TCP connection to server on the iOS device. After that you can just write and read data over USB using streams at 480MBits.
There are some frameworks under MIT license with example apps for OSX and iOS that allow you to use this mechanism in your own apps:
https://github.com/jensmeder/DarkLightning
https://github.com/rsms/peertalk
This mechanism is App Store compliant in case u need to publish your app later. One popular example is an app called Duet Display that allows you to use your iPad as a second screen via USB.
Hope that helps.
Related
Android provides "adb" as a mechanism for communicating between host and apps on a USB-connected device. This is useful for automation (e.g. execute some code on the device and collect the results). We need this capability for iOS. Does a similar mechanism exist for iOS?
Yes, there is a similar mechanism. The underlying technology/service is called usbmuxd. It is basically a multiplexing service that allows you to connect to your iOS device via USB using the TCP protocol. Apple uses this service for any communication between your iOS device and iTunes or Xcode, e.g., to install apps via iTunes.
If you want to leverage this mechanism, there is a library that provides a high level API for iOS. They have reverse engineered the whole protocol including things like remote debugging via lldb and app installation.
http://www.libimobiledevice.org
If you just want to sideload compiled binary bundles into your own app you might get away with using my library. It allows you transmit arbitrary data via USB to your app and supports both iOS and tvOS.
http://www.github.com/jensmeder/DarkLightning
Is it possible to send an ASCII code on an external device through USB port using IOS API? I assume that it is possible through bluetooth connection, but I'm not sure through USB connector. Any thoughts?
I would appreciate if someone could put me in the right direction.
Thanking you in advance
That largely depends on the level of sophistication of this "external device". If this external device is just a bare metal embedded device without some sort of operating system you definitely need MFI.
Otherwise, you can run a usbmuxd server (e.g. on Raspberry PI with Linux) to establish a connection via USB. Usbmuxd is basically the technology that Apple uses to communicate between iOS devices and Desktop apps such as iTunes or Xcode. And yes, it is App Store compliant, e.g., Duet Display uses this approach to make an iPad a secondary display for your Desktop via USB.
There are several open source libraries that provide a high level API, e.g., PeerTalk or DarkLightning.
I am working on developing an enterprise application for ios 7 that needs to work offline and then sync with a desktop client (that I also need to write) for data transfer.
My company does not allow wireless or cell data in this area, and would strongly prefer to not use iTunes either.
The question is, how do you transfer data from an iPad over the usb cable to a custom windows program, without iTunes.
The simplest answer would be: iExplorer (http://www.macroplant.com/iexplorer/) plus some kind of a script to automate the data sync.
Otherwise, you can use the ExternalAccessory framework to communicate with the desktop via a USB tether. This would necessitate a desktop client running simultaneously to communicate with the device.
peertalk (https://github.com/rsms/peertalk) does what you want, however the computer side library is only for mac os. Maybe you can port the protocol to windows by looking at that (the license is BSD)
Edit: this guy managed to have it run under linux. It sits on usbmuxd, which also has a windows port, so it shouldn't be impossible.
I am developing an iOS app, which may need to sync a large amount of data with its OSX counterpart app, and for the use case in which the app would be used there may not be an internet connection available to connect either of the devices (iOS device & Mac).
Is there an official apple api that lets one sync data between an iOS app, and its OSX counterpart, without having to use the internet or iCloud ?
As far as I can tell, short of joining the MFI program, there isn't a way.
If you don't mind the user dragging some documents around, then you can create documents which can be accessed via iTunes: http://www.raywenderlich.com/1948/itunes-tutorial-for-ios-how-to-integrate-itunes-file-sharing-with-your-ios-app
What makes you think you need an Internet connection for WiFi?
If you are close enough for a USB cable, just create a WiFi network from the Mac (WiFi icon in the menu bar, "Create connection..."). Use bonjour to discover services, and then the apps can talk to each other.
My app needs to transfer data to and from a PC/Mac, but without using Wireless or 3G.
Is it possible to use the USB cable to run a server on the device accessible by the PC/Mac?
Accessing the app's documents-directory over USB from a program would work too.
What would be the best way? I need a solution, that will work on normal device, no jailbreak allowed. If it works without special drivers on the PC/Mac, that's a bonus too.
You should enable UIFileShareEnabled. More information is available here:
iTunes Documents Directory in my app