ZSH:找不到命令:Mac OS中的ADB

发布于 2025-02-07 10:03:07 字数 1103 浏览 2 评论 0原文

我正在获取ZSH:找不到命令:ADB错误,即使更新了我的.zshrc文件。 我已经在.zshrc文件

# For ADB
export ANDROID_HOME=/Users/aanshu/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH

neclare -p path返回以下路径中添加了以下路径

export -T PATH path=( /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/.nvm/versions/node/v12.16.1/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin )

I am getting zsh: command not found: adb error even after updating my .zshrc file.
I have added the following path in my .zshrc file

# For ADB
export ANDROID_HOME=/Users/aanshu/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/tools/bin:$PATH

declare -p PATH is returning the following path

export -T PATH path=( /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /Users/aanshu/.nvm/versions/node/v12.16.1/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools/bin /Users/aanshu/Library/Android/sdk/platform-tools/adb/tools /Users/aanshu/Library/Android/sdk/platform-tools/adb/platform-tools /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/Apple/usr/bin )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好菇凉咱不稀罕他 2025-02-14 10:03:07
export ANDROID_HOME=/Users/aanshu/Library/Android/sdk/platform-tools/adb

...显然是错误的。相反,它应该是:

export ANDROID_HOME=/Users/aanshu/Library/Android/sdk

...因为它提供了后续行附加的基础。

export ANDROID_HOME=/Users/aanshu/Library/Android/sdk/platform-tools/adb

...is obviously wrong. It should instead be:

export ANDROID_HOME=/Users/aanshu/Library/Android/sdk

...because it provides a base to which the subsequent lines append.

故事未完 2025-02-14 10:03:07

很抱歉最近回答这个..
对我来说,这些是我所做的。

  • •将平台工具复制到用户主文件夹
  • •然后打开终端并输入“ nano .zshrc”
  • •在该文本编辑器我添加了以下行

导出路径= $ path = $ path:/user_name/user_name/android-sdk-macos/platform -tools/

  • 然后保存IT用户控制+X并退出文本编辑器

  • •在终端i中输入“ source〜/.zshrc”

  • •关闭所有终端并重新审核它。

    就是

,我尝试了终端中的ADB设备来测试它是否有效。而且正在工作

Sorry to answer this this lately ..
For me these are the things that I did.

  • • Copy the platform-tools to the user home folder
  • • Then opened terminal and entered “ nano .zshrc ”
  • • In that text editor I added the below line

export PATH=$PATH:/Users/user_name/android-sdk-macos/platform-tools/

  • then save it user control+x and exit the text editor

  • • In the terminal I entered “ source ~/.zshrc “

  • • Closed all terminals and reponed it.

    That’s it

Then I tried adb devices in the terminal to test if it works or not. and It was working

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文