/bin/sh:adb:找不到命令 [英] /bin/sh: adb: command not found
问题描述
当我尝试在设备上运行我的React Native应用程序时,收到以下消息/bin/sh:adb:命令未找到
.该应用仍然可以在我的手机上运行,但无法重新加载或远程调试它.
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.
我的adb文件在〜/Library/Android/sdk/platform-tools
中.
我尝试做 sudo nano〜/.zshrc
,然后在用户配置"下添加了 export PATH =〜/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.
当我执行 echo $ PATH
时,我得到以下信息(但我不知道它是什么意思:():/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
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?
推荐答案
请尝试:
export ANDROID_HOME=/Users/{yourusername}/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
这篇关于/bin/sh:adb:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!