32

This app promises to turn your iOS device into a second monitor and uses the standard USB cable to connect to the computer, as opposed to the network which all other similar apps use.

Back when I heard about it, it wasn't yet available so I thought it was a scam. To my surprise, they released the app and it actually works as described.

How does it work ? As far as I know there are no APIs to drive the USB port in iOS, and the computer connected via USB through the standard charging/syncing cable doesn't count as an MFI accessory.

Note that they provide the server software (the one that installs on the Mac and streams the desktop to the device) on their download page for free, reverse-engineering it could shed some light on this but I unfortunately don't have the skills for that.

2 Answers2

39

Dean told about it on his blog.

Duet uses Peertalk, an open source library allowing to pass TCP connections through the USB connection without being part of the MFI program.

Huy Le
  • 2,503
  • 1
  • 15
  • 15
  • Thank you so much, finally a correct answer. I've edited it to include a bit more details so it isn't a link-only answer anymore. –  Feb 25 '15 at 09:52
  • 2
    does peertalk work on windows to allow it to connect to iOS device using USB cable ? – Saeed Mar 05 '18 at 20:35
  • 1
    @Saeed On windows, there is a open source library "libimobiledevice". You could define the same protocol as peertalk, then you could communicate with iOS devices. – srjohnhuang Nov 29 '18 at 03:23
  • How does one get the port number of the attached device? – Adam Freeman Jan 18 '20 at 03:57
5

The information, code and tools to accomplish generic USB port communication is available to those who join the Apple MFi program. You have to do the paperwork and get licensed by Apple.

http://developer.apple.com/programs/mfi/

The libraries necessary are included in the app and then the usual streaming libraries and code do the rest.

Reenactor Rob
  • 1,508
  • 1
  • 11
  • 20
  • But doesn't MFI require a custom device implementing the accessory protocol at the end, and not just a computer and the standard Lightning<->USB cable ? –  Jan 24 '15 at 17:06
  • I would think that the Mac OS and iOS get along in that regard. I am confused as Andre says the system uses a standard USB cable when the Duet website clearly says the lightning or 30 pin cable is necessary. – Reenactor Rob Jan 24 '15 at 20:15
  • Yeah, by "standard USB cable" I meant the standard Lightning to USB or Dock to USB cables we're used to, as opposed to a custom made cable that appears as an MFI accessory to the iOS device. –  Jan 24 '15 at 20:33
  • Connections are accomplished using the ExternalAccessory.framework. Duet then installs audio and video drivers that do the rest. – Reenactor Rob Jan 24 '15 at 21:04
  • Could you provide more detail, and if possible some sample code ? I find it hard to believe that if this is true, why is Duet the only app to have done this so far... –  Jan 25 '15 at 17:20