Not able to access adb in OS X through Terminal, “command not found”

后端 未结 18 1509
囚心锁ツ
囚心锁ツ 2020-12-04 04:43

I have installed Android SDK and Eclipse on my Mac system. I am able to program using Eclipse and have created few sample applications. But I am still not able to access

相关标签:
18条回答
  • 2020-12-04 05:40

    If you are using zsh on an OS X, you have to edit the zshrc file.

    Use vim or your favorite text editor to open zshrc file:

    vim ~/.zshrc
    

    Paste the path to adb in this file:

    export PATH="/Users/{$USER}/Library/Android/sdk/platform-tools":$PATH
    
    0 讨论(0)
  • 2020-12-04 05:41

    I don't know how did you install the android SDK. But in Mac OS, what really worked for me is to reinstall it using brew. All problems solved in a row.

    brew cask install android-sdk
    

    Later on:

    android update sdk --no-ui --filter 'platform-tools'
    

    Like a charm

    0 讨论(0)
  • 2020-12-04 05:41

    I couldn't get the stupid path working so I created an alias for abd

    alias abd ="~/Library/Android/sdk/platform-tools/adb"
    

    works fine.

    0 讨论(0)
  • 2020-12-04 05:41

    For Mac Os the default shell has moved on to "zsh" from "bash" as of Mojave and later releases, so for all the Mac users I would suggest go with the creating ".zshrc" file. "adb" runs as it is intended to be. Thanks @slhck for your info.!

    0 讨论(0)
  • 2020-12-04 05:41

    It's working fine..

    brew install android-sdk
    

    Later on:

    android update sdk --no-ui --filter 'platform-tools'
    
    0 讨论(0)
  • 2020-12-04 05:43

    Or the alternative solution could be

    1. Make sure you already install for android SDK. Usually it is located under /Users/your-user-name/Library/Android/sdk
    2. If the SDK is there then run this command. ./platform-tools/adb install your-apk-location

    3. From there you can generate the APK file That's the only sample to check if adb command is there

    0 讨论(0)
提交回复
热议问题