How do I run adb on a mac terminal?

前端 未结 6 1317
一个人的身影
一个人的身影 2021-02-02 07:29
adb shell run-as /data/data/com.mypackagename 

returns

adb command not found

though I see adb in the dir

6条回答
  •  终归单人心
    2021-02-02 07:57

    The first step, you should get android sdk directory path by open:

    Android Studio -> Preferences -> Appearance & Behavior -> System Settings -> Android SDK

    The path will be show here. example: /Users/thisismyaccount/Library/Android/sdk

    Next, you open Terminal and type command as below:

    echo 'export PATH=$PATH:/Users/*thisismyaccount*/Library/Android/sdk/platform-tools/' >> ~/.bash_profile
    
    source ~/.bash_profile
    
    adb devices
    

提交回复
热议问题