Today we're excited to open-source a feature that we've been using in production for the last 3 years: an iOS VNC Server.
This will allow you to connect with your favorite VNC Client to a physical iOS device (no jailbreak required).
The program streams the screen of the iOS device through VNC and listens for mouse and keyboard events.
Setting it up
To get started, please clone the git repository: ios-vnc.
Next, please install these dependencies:
brew install libimobiledevice
brew install libpng
brew install libvncserver
brew install carthage
You can now build the project:
cd iOSVNCServer && make build
Dependencies
To control the device, you will need to set up WebDriverAgent.
This project exposes a couple of endpoints to take control of the device.
Once you've set this up correctly (signing and ./Scripts/bootstrap.sh
), you can run the WebDriverAgent project to expose the HTTP endpoint.
Getting Started
The WebDriverAgent project will output a response similar to ServerURLHere->http://[SOME_IP]:8100<-ServerURLHere
.
These values are required and need to be passed to our iosvncserver
, together with the udid
of the device:
- To get the udid:
idevice_id -l
- Start a WebDriverAgent session:
curl -X POST -H "Content-Type: application/json" \ -d "{\"desiredCapabilities\":{\"bundleId\":\"com.apple.preferences\"}}" \ [SOME_IP]:8100/session
- Copy the sessionID from this response and pass it to our VNC server
You can now run the VNC server:
./iosvncserver -u [udid] -H [SOME-IP] -P 8100 -S [session-id]
And that's it! You can now point your favorite VNC client to `localhost:5901` and you will be able to view and take control of the iOS device.
Future plans
In the future we hope to improve the performance of both the rendering and the controls. All Pull-Requests and suggestions are welcome.