最近筆者在開發(fā)一款A(yù)pp 需要把數(shù)據(jù)從iOS App傳輸?shù)诫娔X 在苦苦研究了一天以后 筆者有了兩種想法
? ? 1 使用wifi網(wǎng)絡(luò)連接 電腦端建立服務(wù)器 iOS端建立客戶端 發(fā)送數(shù)據(jù)包
? ? 2 使用USB線纜 像Surge和Duet那樣傳輸數(shù)據(jù)
在考慮到需要開發(fā)的App的特殊性滑负,對于延時要求較高的App來說,wifi連接就顯得不那么可靠撒强。于是筆者開始研究冯乘。由于Google資源極其稀缺属提,筆者直接聯(lián)系了Code-Level Support矮烹。(沒錯就是一年兩次的Apple官方代碼支持)
可是 回復(fù)令在下有點失望 氣死我了
The type of communications which you have asked are not supported by the iOS device. There is a private API used by iTunes which allows it to communicate with the device with regards to audio and file content on the device. However, there is no public API support to facilitate communications with an iOS application running on the device. If you are looking for such interaction between the device and the desktop host, you might want to instead investigate communications across a WiFi connection.?
于是我追問App Store中有些已經(jīng)上架了的App有這個功能是怎么實現(xiàn)的葱弟,得到的答復(fù)也不盡如人意
I’m aware of the Duet application. However the mechanism employed by Duet is not a public API for either iOS or macOSX. DTS only supports and discusses public API’s. Private API’s are not supported by DTS.
于是我繼續(xù)追問有沒有好的建立較好數(shù)據(jù)實時傳輸?shù)姆桨?/p>
Hello,
My response regarding WiFi was for you to implement a server client set of applications - one for the iOS device and one for the desktop system. For example, on the desktop system you could set up a web server, then implement the web client on the iOS device. Given the information you’ve provided so far, this would achieve the goal of communications between the 2 systems. However, this is unlikely to be the solution which you desire. Since you’d asked about Duet, I suspect you are looking for a more straightforward means to set up the communications.
The one means which I can think of would be to implement an MFI accessory to sit between the iOS device and the desktop system. However, DTS is here to support API level questions. I’m happy to answer direct questions about the use of an API. However, providing specific solutions to a design goal, we can only offer solutions where we are aware of them. Unfortunately, the Duet solution is not one that I can discuss. However, if you can ask a more specific API level question, I’m happy to have this incident billed to respond.
然后 就被吼了 大概意思是 你這個App還是用USB傳輸吧 但是這要靠你自己 不要想著換個方案用wifi他不適合你造嗎
然后 我就開始研究數(shù)據(jù)傳輸?
? ? 1 我記得有一個framework名字叫l(wèi)ibimobiledevice
? ? 2 在下花了將近100大洋購買了Surge軟件 為什么求助一下举塔?绑警! (克金玩家福利)
于是我得到了這樣的回復(fù)
參見 libimobiledevice 這個項目
Kind regards,
Surge Networks Inc.
很棒 證明了我的想法 于是我開始從茫茫文獻(xiàn)中尋找資料 我在libimobiledevice中找到了一份資料
libimobiledevice API?:?https://www.libimobiledevice.org/docs/html/files.html
接著我在Google的一個項目代理中找到了這樣一張圖片
我們可以看到 底層的USB傳輸協(xié)議名字是usbmuxd 這份協(xié)議被包括在libimobiledevice項目中
usbmuxd: A socket daemon to multiplex connections from and to iOS devices.
在接著往下看
To developers, itmeans you can connect to any listening localhost socket on the device.
Fine 是時候開始研究了
未完待續(xù)
2018.10.15?
然后我看到這么一個框架 看起來很好吃:https://github.com/rsms/peertalk
PeerTalk is an iOS and Mac Cocoa library for communicating over USB.
等待研究