title: emulator-5554 unauthorized for adb devices
body: <p>I'm trying to get my react-native project to run on an android emulator while on a Mac operating system.  It worked fine on my windows.</p>
  <p>On my Mac, I go to terminal and type <code>react-native run-android</code> and I get the error message:</p>
  <pre><code>$ react-native run-android
  Scanning 616 folders for symlinks in /Users/John/Documents/myreactnativeproject/node_modules (17ms)
  Starting JS server...
  Building and installing the app on the device (cd android &amp;&amp; ./gradlew installDebug)...
  Could not install the app on the device, read the error above for details.
  Make sure you have an Android emulator running or a device connected and have
  set up your Android development environment:
  https://facebook.github.io/react-native/docs/android-setup.html
  </code></pre>
  <p>I type <code>adb devices</code> and I see</p>
  <pre><code>List of devices attached
  emulator-5554   unauthorized
  </code></pre>
  <p>I go into the settings of my android emulator, I go to Settings Build Number to tap it several times to enable Developer options.  In developer options, I enabled USB debugging, disabled Verify apps over USB, and left everything else as default.  I shut down my android studio and emulator, restarted it.  But still, the same issues mentioned above.</p>
  <p>What am I doing wrong?</p>
  <hr />
  <p><strong>EDIT</strong></p>
  <p>I just connected my android phone to my Mac.   When I run <code>adb devices</code>, I see this result</p>
  <pre><code>List of devices attached
  YLEDU16B18004313    device
  </code></pre>
  <p>But when I run <code>react-native run-android</code>, I get the same error as above.  So maybe there is something wrong with my react-native set up instead?</p>
  <hr />
  <p><strong>EDIT 2</strong></p>
  <p>I was able to deploy the app to my android phone by adding these extra steps</p>
  <ul>
  <li><p><code>chmod 755 android/gradlew</code></p>
  </li>
  <li><p>For some reason, when I type <code>echo $ANDROID_HOME</code> into the terminal, I get the result <code>/Users/John/Library/Android/sdk</code>.  But if I add the <code>echo $ANDROID_HOME</code> line to my <code>android/gradlew</code> file, it echoes nothing.  And when I run the <code>react-native run-android</code> command, the compiler complains that ANDROID_HOME is not defined.  So I have to type <code>export ANDROID_HOME=/Users/John/Library/Android/sdk</code> again, then running the <code>react-native run-android</code> command works and deploys it to my phone.</p>
  </li>
  </ul>
  <p>However, my emulator still doesn't work. The new error message I get is that <code>Skipping device 'emulator-5554' (emulator-5554): Device is UNAUTHORIZED,</code>.</p>
  <p>But at least I have a temporary solution, and to debug with my phone.</p>
  <hr />
  <p><strong>EDIT 3</strong></p>
  <p>I got rid of the <code>emulator 5554 unauthorized</code> error by going into my Android Virtual Devices and deleting the virtual device.  Then I re-installed it.  And now my adb devices shows <code>emulator 5554 device</code>.  And I am not able to deploy the app to my emulator.</p>