The company points out that the release gives mobile web developers a way to simplify daily workflow. Making the debugger available on Windows brings developers more options. Before the release debugging websites for on iOS devices came with specific requirements. Chiefly the Safari Web Inspector needed a desktop Safari link.
Considering Safari is only available on MacOS, the limitations for dev’s were obvious. Microsoft’s confirmation of the iOS Debugger for VS Code brings debugging capabilities for iOS to the Windows platform.
In its blog post, Microsoft says the iOS Web Debugger has similar functionality to the company’s Chrome debugger. That means the new release is powered by vscode-chrome-debug-core library. The open source library has been migrated from the Chrome debugger to the iOS debugger for Visual Studio Code. Microsoft explains how it works:
“To make the connection from our debugging library to the iOS device, we are leveraging two open source projects, ios-webkit-debug-proxy and ios-webkit-debug-proxy-win32, that enables communication with the iOS devices over USB through the WebKit Remote Debugging Protocol. The protocol is compatible with the Chrome Debugging Protocol for the script debugging APIs, and this means our debugger works without additional mapping logic.”
Emulating Port Forwarding
The primary goal of the new iOS debugger is to give developers improved local development. Microsoft achieves this by emulating port forwarding, which is something iOS lacks natively. Other platforms, like Android, support port forwarding to help dev’s access the HTTP-based local server. Microsoft had to emulate this process in iOS.
To solve the limitation, the company created an option for an instance of localtunnel. This instance creates an HTTP tunnel from a local machine to public internet, which the iOS device accesses to reach the development server.