communicate with iphone via USB port on mac - iphone

So what I need help with is communicating with the iphone via a mac program. I don't want to do complicated stuff, I mainly just want to send the "screenshot" command, much like xcode does in the organizer window, however I want to be able to do my own things with it.

Check http://code.google.com/p/iphonedisk/
It uses MacFUSE. While it seems to have some problems it is a good start and I was using it a couple of years ago.

This site lists a way to connect to SSH through a USB connection:
http://oss.coresecurity.com/iphonedbg/usb_tunnel_doc.htm
It would be useful for a jailbroken iPhone.
As for other possibilities I haven't looked into, iphuc might be able to do get you just the screenshot capability without requiring you to be jailbroken. You will probably need to sniff them while running the organizer.

Related

Is there any method to log into blackberry 10 through usb cable

Now I face a tricky problem. My Blackberry Classics has a black screen problem. When I connect it to my laptop with USB cable, Blackberry Link can detect it. However when it tried to connect to it, the Blackberry Blend prompted me to set the Allow Connections switch to on on the device. Obviously, I could not do that. I am thinking maybe there is a method to let me connect to the Blackberry 10 through the USB port just like a console port, but I am not sure. Does anyone know about it? Thanks in advance.
Momenitcs does provide a few ways to connect with a device. But generally the device has to be in development mode, which requires interacting with the device which you apparently can't do. The access is also limited to the development user so you could not use it to, for example, access data from installed applications.
About the only thing you can do at this point is use link to backup your data and restore to that phone once repaired, or to a new phone.
Also, since this question is not really suitable for StackOverflow I'm going to flag it for closing. Questions like this properly belong on SuperUser http://meta.superuser.com/questions/4836/what-is-the-difference-between-super-user-and-stack-overflow/4838

iPhone simulator writes to socket fine - but not iPhone

Despite working earlier, my socket chat app now refuses to write to socket on the iPhone!
It works fine on the simulator and again, used to run fine on my phone. I don't really know where to start troubleshooting this issue --- just seems weird. My server doesn't detect anything trying to connect.
Any ideas on how to start troubleshooting this?
Thanks tons.
I did run into a problem where using sockets on the iPhone would not open up the cell phone network unless something else opened it first. I had to run an http call to a generic web site first, and then the sockets would communicate normally. Try putting a call, like sendSynchronousRequest, to a generic web site, like www.apple.com, before opening your socket, and see if it works in that case.
I need to stop wasting all you nice peoples' time.
Long story, my friend updated to iOS 5.1. Now the 3G network reads 4G on iOS 5.1. So I turned off my (5.0) wifi to see if mine cell network was "4G" (which, of course, it wasn't).
But yeah, having turned off wifi my app could no longer join my locally hosted server...
I grabbed Charles though, and it looks handy, so thanks for that anyways. Also Owen's comment about the cell network originally made me think about checking my wifi, as my app shouldn't even be using the cell network yet. But I'll keep in mind what you said for the future.
Thanks everybody!

How to create a Mac/PC server app that interacts with iPhone/iPad App?

Can someone please point me in the right direction to create a Mac/PC server app that runs in the background and connects to an iPad app over the local WiFi network?
No matter how I phrase a search on Google it just brings up various apps like Remote Mouse and whatnot and no tutorials or even a hint of where to start.
I just need to send simple commands from iPad to computer over local wifi. A point in the right direction and I can likely fill in the blanks.
Thank you.
Thomas
EDIT: I am using web languages for the iPad version that I will build as a native app using open source tools.
OK, then. It actually depends on what you really need. I made the assumption you need real-time and perhaps binary data transfer.
Your best bet is to write your server application using standard C or C++ so it compiles on both as simply as possible.
If you want to avoid all the burden of writing a protocol for service discovery or asking users to enter the ip address of your server you will use a mDNS implementation for your server and your iPhone app.
If I were you I would try bonjour: http://www.apple.com/support/bonjour/
on iPhone You could start here: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
Once you have your sockets you will have to implement a networking protocol between your server application and your iPhone app.
You will have to be careful about byte ordering and little subtle problems with latency, disconnections and other problems inherent to networking and WiFi.
In windows you will want to register your application as a service and in Mac OS X/UNIX you'll probably want to deamonize it.
Good luck!

iPhone to Mac Sync Over Wi-Fi

I am writing an iPhone application and would like to sync data over Wi-Fi between the iPhone and a complementary Mac application which I will also be writing (much like what is accomplished with Things and 1Password). To provide specific context, I need to be able to upload a CSV file to the iPhone application, have the ability to edit the data on the iPhone, and then re-download that file to the computer.
I am familiar enough with the mechanics of parsing and editing the CSV file once on the iPhone, but I am unsure how to approach the Wi-Fi sync between the iPhone and Mac. Obviously this is possible, since other applications have achieved the same thing, but do I need to setup some kind of server on the iPhone (which the Mac can talk to) or maybe a server in the Mac-side application (which the iPhone can talk to).
Any suggestions would be greatly appreciated. Thanks in advance.
In my apps, I use CocoaHTTPServer to get local info into and off of the phone. You run the server and out-of-the-box, it indexes all the files in the documents directory.
To do what you want, you will need to edit the code to return some other kind of data format (xml probably is the easiest) the call this from inside your app to get that data. CocoaHTTPServer easily take POST right out of the box too, so you can post an xml response as well.
After thinking about it, CocoaHTTPServer is best run on the computer side behind the scenes. the iphone can then send info to the computer where handling the code should be easier and you have more options.
On top of this you will want to look into Bonjour, it will allow the computer and the iphone to discover each other without too much difficulty. (ie by advertising their info on the network)

iPhone interaction between PC app and iPhone app using USB

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
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.
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.
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.