code: public static ViewServer get(Context context) {
          ApplicationInfo info = context.getApplicationInfo();
          if (BUILD_TYPE_USER.equals(Build.TYPE) &&
                  (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
              if (sServer == null) {
                  sServer = new ViewServer(ViewServer.VIEW_SERVER_DEFAULT_PORT);
              }
  
              if (!sServer.isRunning()) {
                  try {
                      sServer.start();
                  } catch (IOException e) {
                      Log.d(LOG_TAG, "Error:", e);
                  }
              }
          } else {
              sServer = new NoopViewServer();
          }
  
          return sServer;
      }
docs: Returns a unique instance of the ViewServer. This method should only be
  called from the main thread of your application. The server will have
  the same lifetime as your process.
  
  If your application does not have the <code>android:debuggable</code>
  flag set in its manifest, the server returned by this method will
  be a dummy object that does not do anything. This allows you to use
  the same code in debug and release versions of your application.
  
  @param context A Context used to check whether the application is
  debuggable, this can be the application context