Getting started

RemoteDebug iOS WebKit adapter works both on Windows and MacOS, and to get started simply install the adapter via NPM:

npm install remotedebug-ios-webkit-adapter -g

Depending on your OS there might be special dependencies needed, please follow the instructions in the README for more details.

Using the adapter with Chrome DevTools, VS Code and Firefox debugger.html

To get started you first need to start the adapter from your favorite command line:

remotedebug_ios_webkit_adapter --port=9000

Once the adapter is running you can configure Chrome DevTools to discover “Network targets” by following this guide, or you can start the adapter running on port 9222 , which enables Firefox debugger.html to work with it.

Alternatively you can also configure VS Code to use port 9000 with the following launch.json config, and enable easy debugging directly from your editor.

Thanks to Microsoft for sponsoring the work

This project started as an internal Microsoft experiment with the aim to enable Visual Studio, VS Code and other tools to transparently target different runtimes, as we today have debuggers based on CDP used for Node and Chrome debugging.

Today the project has been donated to RemoteDebug GitHub organization, and open-sourced under MIT. This is a one-time commitment from Microsoft and means Microsoft won’t be maintaining the project going forward.

A big thanks to my employer Microsoft for allowing me, and the rest of team to spend time on making this project a reality. A particular thanks to James Lissiak for outlining the architecture, crunching through the API differences and figuring out the screencasting bits.

Going forward

The next step for RemoteDebug iOS WebKit adapter is to implement the 32 remaining APIs, which would give the adapter coverage of the public APIs in the Chrome Debugging Protocol, which I hope the community can help with.

The adapter isn’t perfect, and it’s still early days, but it takes over from where the ios-webkit-debug-proxy project left, and enables more tools to debug WebKit on iOS which is great! Profiling is still one of the bigger things that needs to get tackled, but I imagine it will be hard to do, as the underlaying data model between WebKit and Chrome simply has diverged too much. That said, if possible, it could enable some interesting tooling scenarios as tools like Lighthouse and CalibreApp would work with WebKit.

What’s next for RemoteDebug

The effort for RemoteDebug is still continuing with the goal to introduce a standardized Core Debugging Protocol that isn’t owned by one vendor with an open governance model that allows multiple vendors to collaborate.

The RemoteDebug effort should be combined with “RemoteDebug test suite” that would allow us to validate the compatibility across runtimes and ensure that tools such as VS Code, debugger.html and others works as expected. This testing effort hasn’t begun yet, but with RemoteDebug iOS WebKit Adapter in place, we now have the first test target in addition to the native Chrome implementation.

Please give the RemoteDebug iOS WebKit Adapter a try, open issues and contribute with ideas for improvements on GitHub.

/k

(Thanks to Ben Schwarz, James Lissiak, Jason Laster, Konrad Dzwinel & Andy Sterland for reviewing this post)