Trying to add adb to PATH variable OSX

前端 未结 14 1225
遇见更好的自我
遇见更好的自我 2020-11-28 18:04

I am trying to develop for android and I want to add the adb to my PATH so that I can launch it really easily. I have added directories before by f

相关标签:
14条回答
  • 2020-11-28 18:46

    Add to PATH for every login

    Total control version:

    in your terminal, navigate to home directory

    cd

    create file .bash_profile

    touch .bash_profile

    open file with TextEdit

    open -e .bash_profile

    insert line into TextEdit

    export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools/

    save file and reload file

    source ~/.bash_profile

    check if adb was set into path

    adb version


    One liner version

    Echo your export command and redirect the output to be appended to .bash_profile file and restart terminal. (have not verified this but should work)

    echo "export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools/ sdk/platform-tools/" >> ~/.bash_profile

    0 讨论(0)
  • 2020-11-28 18:47

    In your terminal, navigate to home directory

    cd
    create file .bash_profile
    
    touch .bash_profile
    open file with TextEdit
    
    open -e .bash_profile
    insert line into TextEdit
    
    export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools/
    save file and reload file
    

    source ~/.bash_profile is very important check if adb was set into path

    adb version
    

    It should be fine now.

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