Debug

In this section you will learn how to debug while you are developing for the app on both Android and iOS devices.

Android debugging

Enable Android USB debugging

If you haven’t already enabled USB debugging on your Android phone, do the following steps:

  1. Go to Settings > About (or similar)
  2. Tab the Build number (it may be in a sub-menu) seven times to make Settings > Developer Options available.
  3. Go there and enable the USB-debugging option.

A more thorough walk-trough of the process is available [here](https://developer.android.com/studio/debug/> dev-options).

Chrome Developer Tools for your app

In your PC’s Chrome browser go to chrome://inspect and stay on that page.

Next, connect your phone to your PC and open your test version of the app. You may need to allow the connection to the PC on phone. Select the always allow option.

In your Chrome browser you should now see your phone under Remote Target. You should now look for the WebView and below this click Inspect.

And viola - you are now able to debug the app with the Chrome Developer Tools at your side.

Further Insights

If you wish to learn more or if you have issues with the description above, you may want to read this > article on the subject.

iOS debugging

Enable Developer Mode in Safari on Mac

Before debugging iOS WebViews, you need to enable Developer Mode in Safari on your Mac. Here’s how:

  1. Open Safari.
  2. Go to Safari > Preferences in the menu bar.
  3. Click on the ‘Advanced’ tab.
  4. At the bottom of the window, check the box next to ‘Show features for web developers’.

This will add the Develop menu to Safari, giving you access to additional tools for debugging and > development.

Enable iOS Web Inspector

To debug on iOS devices, you need to enable the Web Inspector. Follow these steps:

  1. Go to your iOS device’s Settings > Safari > Advanced.
  2. Toggle on the Web Inspector option.
  3. Connect your iOS device to your Mac using a USB cable.
  4. Open Safari on your Mac and go to Develop in the menu bar.
  5. Under this menu, select your iOS device and the app and WebView you want to inspect.

Now, you can use Safari’s Web Inspector to debug your iOS app, similar to how you use Chrome Developer Tools > for Android.