Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Facebook open sources Sonar, their cross-platform debugging tool

Save for later
  • 180 min read
  • 2018-06-12 04:45:46

article-image

Facebook has announced the open-source release of Sonar, their cross-platform debugging tool. Sonar is designed to aid developers, framework experts and engineers collaborate on the app development process. Sonar is built on Facebook’s Stetho, an Android debugging bridge built on Chrome's developer tools. Sonar further adds more extensible features to Stetho such as plugins to help engineers develop new features, investigate bugs and optimize apps.

Sonar is a cross-platform debugging tool. Hence developers can connect their mobile devices (Android and iOS or an emulator) to a desktop client for inspection. Sonar works as a guide and interpreter to a running app providing developers with stats on what an app is doing to better understand bugs and system capabilities.

Sonar is now available for the developer community at large, not just Facebook engineers, as an open-source software project via GitHub.

As Sonar was designed with extensibility in focus, it made use of a lot of external plugins. With the open sourcing of Sonar, these plugins are also being open-sourced. Some of these include:

  • Logs, a plugin that shows device logs without the need for additional setup.
  • Layout Inspector, a debugging platform that provides deep dives into user interface hierarchies and supports Litho and ComponentKit components.
  • Network, a plugin that enables the inspection of network packets as they pass into and out of the app in question.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at AU $19.99/month. Cancel anytime

Sonar architecture


Sonar’s architecture has two parts, a desktop client, and a mobile SDK. The desktop client is built on top of Electron, and Facebook's projects such as React.js, Flow, Metro, RSocket, and Yarn.

The mobile SDK is installed within the Android or iOS application and interacts with the desktop client. The mobile SDK makes use of Facebook open source projects such as Folly and RSocket.

Plugins are available for both Desktop client and Mobile SDK. Desktop client plugins render the UI and a mobile SDK plugin exposes the data. A React component extends the desktop plugin class. This React component is in charge of communicating with the mobile SDK plugin and rendering any data it delivers.

The mobile SDK plugin is developed in the language native to the platform on which it will run (Swift/Objective-C on iOS or Java/Kotlin on Android). It registers a set of handlers and defines responses for them.

facebook-open-sources-sonar-their-cross-platform-debugging-tool-img-0

Source: Facebook Blog


Emil Sjölander, Facebook software engineer hopes that “open-sourcing Sonar and the accompanying plugins will provide a useful tool for other engineers working on mobile applications.” He says that “As we've already seen Sonar prove useful internally at Facebook, we think Sonar's APIs will help other engineers build great new experiences to improve their workflows.

You can read about the full release coverage on Facebook code blog.

Jest 23, Facebook’s popular framework for testing React applications is now released
Facebook’s F8 Conference – 5 key announcements
Testing Single Page Applications (SPAs) using Vue.js developer tools