Step 10The iPhone Client Program
Now to set up the iPhone client program.
For the client code, I’m using a program I found on Anthony Pray’s Google Code page. This program reads input from the serial port at 19200 bps and then injects the appropriate keyboard event using a VNC client library. I’ve made a local text-only mirror of the source here, which can be easily fetched with wget.
Since we’ll be injecting keypresses by VNC, you’ll also need to be running a VNC Server on the iPhone. We’re going to use Veency (which is awesome and you should install anyway).
Go to Cydia or Icy and install the following packages:
- Veency - Provides the VNC Server, configure it to run at startup
- LibVNCServer - Provides libvncclient
- iPhone 2.0 Toolchain - Provides a build environment (gcc, libgcc, ldid, libz are required if you go another route)
- MobileTerminal - So you can access the iPhone terminal
- wget - So you can pull down the source file
Now to download and build the source. Either open up MobileTerminal or SSH into your phone, and then do the following:
- wget http://awgh.org/files/TouchClient.c
- gcc -static-libgcc -o TouchClient TouchClient.c -lvncclient
- ldid -S TouchClient
The last step, using ldid, fakes signing the binary. Without it, the iPhone OS will kill your process immediately.
To start the program, run it from Mobile Terminal with:
./TouchClient
This will cause Veency to pop up a dialog asking if you want to accept the VNC connection. Hit Accept.
I’ve noticed that running this from MobileTerminal keeps the program alive even when you leave MobileTerminal, but it would be better to use launchd. I haven’t figured that out just yet.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































