Paul Krill
Editor at Large

Microsoft brings iOS JavaScript debugging to MacOS, Windows

news
Aug 25, 20162 mins

The iOS Web Debugger for Visual Studio Code is the latest attempt by Microsoft to woo iOS developers

mobile developer and skills
Credit: Thinkstock

Looking to woo Apple iOS developers, Microsoft is enhancing its Visual Studio Code editor this week with the capability to debug JavaScript code for iOS mobile devices.

The iOS Web Debugger for Visual Studio Code is an extension supported on both Mac and Windows PCs that enables developers to debug JavaScript code running in the Safari browser on iOS devices.

Until now, the ability to debug websites running on iOS devices has only been available to a subset of developers, said Kenneth Auchenberg, program manager for dev tools and remote debugging at Microsoft. “For example, using the Safari Web Inspector (Safari DevTools) requires an instance of desktop Safari that only is available for MacOS users,” he said. “Today, we’re enabling mobile web developers to debug JavaScript running on their iOS devices directly from their editor.”

The extension operates in two modes: launching a URL on a Safari device or attaching to a running tab inside Safari. Two open source projects, ios-webkit-debug-proxy, and ios-webkit-debug-proxy-win32 are used for connecting from Microsoft’s debugging library to the iOS device. These projects enable communication with iOS devices over USB via 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,” Auchenberg said.

Features supported in the extension include setting of breaking points, stack traces, debugging of eval scripts, and virtual forwarding via HTTP tunnel from the local PC. Auchenberg explained that it’s cumbersome to enable mobile devices to access a local development server. “To make this easier, platforms like Android support point-forwarding natively, but iOS doesn’t support this.” Instead, Microsoft emulates port-forwarding by adding an option to start an instance of localtunnel, which creates an HTTP tunnel from a local computer to the public internet for a specified tunnelPortproperty. The HTTP tunnel is used by the iOS device to access the local development server.

Microsoft has been courting iOS developers of late. The planned Visual Studio 15 platform has been fitted with a capability to import Xcode projects that leverage C++. The company also acquired cross-platform mobile development tools vendor Xamarin, which supports iOS.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author