title: "adb root" command returns "adbd cannot run as root in production builds" even on an emulator?
body: <p>I'm trying to run the <code>adb root</code> command on an emulator; this is the only device I have attached:</p>
  
  <pre><code>$ adb devices
  List of devices attached
  emulator-5554   device
  </code></pre>
  
  <p>However, I'm getting the following error message:</p>
  
  <pre><code>$ adb root
  adbd cannot run as root in production builds
  </code></pre>
  
  <p>I've tried following this answer, <a href="https://stackoverflow.com/questions/25477424/adb-shell-su-works-but-adb-root-does-not">adb shell su works but adb root does not</a>, to solve my problem:</p>
  
  <blockquote>
    <p>By design adb root command works in development builds only (i.e. eng and userdebug which have ro.debuggable=1 by default). Alternatively you could use modified adbd binary (which does not check for ro.debuggable)</p>
  </blockquote>
  
  <p>It is not clear to me, however, how I can change the build into a development build instead of a production one?</p>
  
  <p><strong>Update</strong>
  I've found some additional instructions which lead me to believe that for this to work, you need to make your emulator a 'writable system' (cf. <a href="https://stackoverflow.com/questions/42647209/how-to-make-system-partition-in-avd-in-emulator-writable">How to make system partition in AVD in emulator writable</a>). However, if I try</p>
  
  <pre><code>$ emulator -avd Nexus_5X_API_28 -writable-system
  emulator: WARNING: System image is writable
  emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
  Please use -read-only flag to enable this feature.
  </code></pre>
  
  <p>I'm not really sure how to parse this error message; does this mean that the system image is already writable?</p>