34

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?

1
  • 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 Dec 13, 2018 at 5:11

1 Answer 1

136

please try:

export ANDROID_HOME=/Users/{yourusername}/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
12
  • 1
    Do I just write this in the terminal? Or inside some files?
    – Tom Bom
    Dec 13, 2018 at 6:03
  • 2
    I wrote it in my terminal and it works now.
    – Tom Bom
    Dec 13, 2018 at 6:14
  • 2
    you must add it in the .bash_profile if you are using mac Feb 16, 2019 at 5:28
  • Ty, worked well! Jun 27, 2019 at 22:56
  • 2
    @OluwatobiSamuelOmisakin that's not needed, you can just run source .bash_profile May 1, 2020 at 15:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.