/bin/sh: adb: command not found

45,456

please try:

export ANDROID_HOME=/Users/{yourusername}/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Share:
45,456

Related videos on Youtube

Tom Bom
Author by

Tom Bom

Updated on July 09, 2022

Comments

  • Tom Bom
    Tom Bom almost 2 years

    When I try to run my react native app on my device, I get the following message /bin/sh: adb: command not found. The app still runs on my phone but I can't reload it or remote debug it.

    There are many questions like this but their solutions don't help me.

    My adb file is in ~/Library/Android/sdk/platform-tools.

    I tried to do sudo nano ~/.zshrc, then under User Configuration I added export PATH="~/Library/Android/sdk/platform-tools" but it didn't help.

    When I do echo $PATH I get the following (but I don't know what it means :( ): /Users/myname/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/.rbenv/shims:/Users/myname/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/.rvm/bin

    I guess I should export the correct path but I don't know where to start from. Any idea?

    • Niels Ladekarl
      Niels Ladekarl over 5 years
      I'm assuming you run OSX. You have to remember the $PATH at the end of the export PATH command. What happens if you run: export PATH="~/Library/Android/sdk/platform-tools":$PATH
  • Tom Bom
    Tom Bom over 5 years
    Do I just write this in the terminal? Or inside some files?
  • Tom Bom
    Tom Bom over 5 years
    I wrote it in my terminal and it works now.
  • Shubham1164
    Shubham1164 about 5 years
    you must add it in the .bash_profile if you are using mac
  • Mike Boutin
    Mike Boutin almost 5 years
    Ty, worked well!
  • Apurva Aggarwal
    Apurva Aggarwal over 4 years
    export ANDROID_HOME=/Users/{youusername}/Library/Android/sdk export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/tools:$PATH
  • Oluwatobi Samuel Omisakin
    Oluwatobi Samuel Omisakin over 4 years
    updating the path helps me too. One note is that you may want to close and re-open your terminal to see the changes.
  • Fabri Pautasso
    Fabri Pautasso about 4 years
    @OluwatobiSamuelOmisakin that's not needed, you can just run source .bash_profile
  • tiennv
    tiennv over 3 years
    ANDROID_SDK works for me.
  • Riku
    Riku over 3 years
    It worked on my end. Thanks!
  • protrafree
    protrafree about 3 years
    is it documented on react native official docs or this is more like hacky way to get it done ? can i get reference link for this ?