Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] /bin/sh: 1: adb: not found #11413

Closed
cyclops24 opened this issue Dec 12, 2016 · 16 comments · May be fixed by hixio-mh/react-native#20
Closed

[BUG] /bin/sh: 1: adb: not found #11413

cyclops24 opened this issue Dec 12, 2016 · 16 comments · May be fixed by hixio-mh/react-native#20
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@cyclops24
Copy link

cyclops24 commented Dec 12, 2016

I try run my first react native app with sudo react-native run-android command but it's return below output and app not running:

sudo react-native run-android
JS server already running.
/bin/sh: 1: adb: not found
Building and installing the app on the device (cd android && ./gradlew installDebug)...
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore0110Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase0110Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp30110Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0392Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug UP-TO-DATE
:app:zipalignDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'Google Nexus 5X - 6.0.0 - API 23 - 1080x1920 - 6.0'
Installed on 1 device.

BUILD SUCCESSFUL

Total time: 12.142 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html
/bin/sh: 1: adb: not found
Starting the app (adb shell am start -n com.myapp/.MainActivity...

As you seen it's return /bin/sh: 1: adb: not found two time but when I run adb devices it's return below output:

adb devices
List of devices attached
192.168.56.101:5555	device

192.168.56.101:5555 is my Genymotion device I also test with my Nexus 7 but again noting run on device.
I think it's a bug because I have adb but it's return /bin/sh: 1: adb: not found.

Additional Info:
Linux Mint 17.2
Android Platform
React Native 0.39.2

@koraniar
Copy link

you need export the path of "platform-tools" inside android sdk folder

run this command with your platform-tools location and retry again
export PATH="/Users/yourUser/Library/Android/sdk/platform-tools":$PATH

@cyclops24
Copy link
Author

@koraniar I export that variable,
My app build and install on a genymotion or real device but still show /bin/sh: 1: adb: not found.
I think it's a bug on message in react-native-cli because it seems anything worked correctly.

@cyclops24 cyclops24 changed the title /bin/sh: 1: adb: not found [BUG] /bin/sh: 1: adb: not found Dec 15, 2016
@paynd
Copy link

paynd commented Feb 22, 2017

I've got the same bug.
adb installed correctly and available from terminal
And it was working yesterday. :\

@sergeiGKS
Copy link

I have the same bug.
Please @cyclops24 , @koraniar did you solve the issue?

@jacobvanorder
Copy link

I added export PATH=$PATH:"/Users/<your username here>/Library/Android/sdk/platform-tools" to my .bash_profile.

@oscar10176
Copy link

I had the same problem I solved,
in your project directory..
sudo apt-get update
sudo apt-get install adb

then

react-native run-android

@jadir-junior
Copy link

@oscar10176 solve for ubuntu 16.04

@Ahsanwarsi
Copy link

You need to install adb.

Run command below to install.
brew cask install android-platform-tools

If you don't have brew installed, use this command to download that:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After installing 'adb' things working fine for me.

@chirag04
Copy link
Contributor

chirag04 commented Oct 4, 2017

@facebook-github-bot answered

@facebook-github-bot
Copy link
Contributor

Closing this issue as @chirag04 says the question asked has been answered.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Oct 4, 2017
@alexxsanchezm
Copy link

alexxsanchezm commented Feb 22, 2018

@koraniar It has to be something else, 200 years ago I have exported adb and other platform tools and still not working... My guess react-native is looking for adb somewhere else and in that case ignoring the ENVIRONMENT vars.

I was right... In a Linux system, react-native scripts looks for adb at /usr/local/bin/, It ignores the Environment variables. what I did was create a symlink in /us/local/bin/

pushd /usr/local/bin/
sudo ln -s /opt/android-sdk-linux/platform-tools/adb
popd

That's it

@mvlasaty23
Copy link

Just also ran into the same issue setting, following resolved it for me:
Set ANDROID_HOME to your sdk location. (C:\users{username}\AppData\Local\Android\sdk per default)

Add the following to your PATH:
%ANDROID_HOME%/tools
%ANDROID_HOME%/platform-tools

Only platform-tools do not suffice. ;)

@dineshmahajan
Copy link

I added export PATH=$PATH:"/Users//Library/Android/sdk/platform-tools" to my .bash_profile.

Thank you its worked for me in mac

@goodwillsandy
Copy link

installing adb manually works for me
in terminal type
sudo apt-get install adb
and then try

@nlwiskus
Copy link

installing worked for me, brew cask install android-platform-tools

@rajnishcoder
Copy link

@oscar10176 you are a hero !!! 👍

@facebook facebook locked as resolved and limited conversation to collaborators Oct 4, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.