title: How to disable remote android debugging of WebView in Ionic/Cordova
body: <p>I have an Android app built on top of the Ionic/Cordova platform. By default Remote Android Debugging is enabled.</p>
  
  <p><a href="https://developers.google.com/web/tools/chrome-devtools/remote-debugging/" rel="nofollow noreferrer">https://developers.google.com/web/tools/chrome-devtools/remote-debugging/</a></p>
  
  <p>This means that if the device is connected to a computer, one can go open the Chrome browser, go to chrome://inspect find a list of webpages, or app's with webviews, click inspect and see the apps HTML, JS and other resources. This is fine for debugging but I'd like this disabled in the released app.</p>
  
  <p>In trying to disable this (or find where its been enabled) I found theres a function </p>
  
  <pre><code>@TargetApi(Build.VERSION_CODES.KITKAT)
  private void enableRemoteDebugging() {
      try {
          WebView.setWebContentsDebuggingEnabled(true);
      } catch (IllegalArgumentException e) {
          LOG.d(TAG, "You have one job! To turn on Remote Web Debugging! YOU HAVE FAILED! ");
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>in SystemWebViewEngine.java in the Cordova directory.</p>
  
  <p><a href="https://github.com/apache/cordova-android/blob/37384c583d5a2e5b9b5c5d2cbf150f07f329d16c/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java" rel="nofollow noreferrer">https://github.com/apache/cordova-android/blob/37384c583d5a2e5b9b5c5d2cbf150f07f329d16c/framework/src/org/apache/cordova/engine/SystemWebViewEngine.java</a></p>
  
  <p>Is there a configuration that can be set or another way for this to be disabled?</p>