views:

1518

answers:

3

Hi, I know since the 3.0 SDK we can use accessories, so my question is simple, what is the process to make an iPhone app and PC (or Mac) app interact, using the USB ?

I don't ask you any code, but just the paths and the keys for making that work.

Have I to access the iPhone disk through SSH and work with files ?

Or can I send data from the iPhone app and intercept (get) it on the PC app (and send data from PC to iPhone) ?

Thanks, and if this question is stupid, just tell me, I didn't find on Dev Center (I don't really know what I have to looking for...) !

Edit : I read some news from Microids, they will synchronize PC and iPhone games (i.g here), and somewhere (I can't find it again) they say connecting the iPhone on the USB, so I think this is possible

+1  A: 

You want the External Accessory Framework. Having said that, I'm not sure that Apple's intention was for you to communicate with an application on a PC/Mac. It's really for talking to accessories such as iPod docks, remote controls, etc. Apple may not allow an application that talks to a PC in this manner in the App Store.

Stephen Darlington
Thanks, I don't only want to use Accessory Framework.But it's possible to communicate through Wifi (i.g Remote controllers for PowerPoint, Keynote etc.). Do they use Bonjour protocol ? What is the way to do that ? And if we can by Wifi I think we can by USB, right ?
F.Santoni
Most it not all apps that connect to computers do use Bonjour. It's in he documentation and no if you can do it by wifi doesn't necessarily mean you can use USB.
JoePasq
Ok, so I hope someone, can answer my question :)I think (and hope), it's possible !
F.Santoni
+7  A: 

USB access on the phone is only supported via the External Accessory Framework. You cannot hook the iPhone up to arbitrary USB devices, the devices actually have to support the EA protocol. You can get more details about it via the Made for iPhone program.

Other than that there is no USB access available on to applications.

Louis Gerbarg
A: 

You might be interested in ssh_relay (earlier called iphone_tunnel).

There is a /System/Library/Lockdown/Services.plist on your iPhone and you can start any such services via AMDeviceStartService and then communicate with it.

The ssh_relay demonstrates how to do that by having a simple port forwarder as a service on the iPhone site and the client application on your PC, so you can forward any local iPhone port to your PC. This is not exactly what you wants here (it is handy in the case you have already another service running on the iPhone which communicates via simple TCP and you want to access that; for example SSH) but based on this example, it should be straight-forward to have any communication between the service (in Services.plist) and your PC.

Albert
This would definitely be an undocumented protocol, and will probably keep you out of the app store. Just for the record.
Kenny Winker