How can I change the default directory of the terminal?

若如初见. 提交于 2020-01-02 10:44:33

问题


I want to change the default directory of the Android Studio (v2.2.2) terminal.

When i open the terminal it is based on the direcetory of the project.

C:\path-of-the-project\

I often have to use adb shell, so i must navigate to the SDK path (platform-tools) to use adb command.

Is it possible to change the default directory of the terminal making it point to the SDK-->tools folder?


回答1:


You can change the default directory of the Android Studio terminal. Go to File->Settings->Tools->Terminal and select the path you want to choose.




回答2:


When we want to open a existing project or anything in Android Studio, this window pops up. The four buttons for path variables on top left of the window is used to help navigating to most frequently used directories as Home Directory, Desktop Directory, Project Directory and Module Directory. The first two are inherited from system variables and the last two are retrieved from current project settings (that's why they're inactive when no project is opened). Here is the answer Change the home directory default location in Android Studio




回答3:


Example for Android Studio (Windows)

File/Settings/Tools/Terminal then:
(a) Set Start Directory to your SDK (e.g. C:\@AS_2.2.2_SDK\platform-tools)
(b) Set Shell path to cmd.exe (just let it default)

When you refresh the terminal session you will be switched to the Start Directory.
Now you are ready to use adb - e.g. type 'adb devices'

[You no longer have to manually type the 'cd' command]



来源:https://stackoverflow.com/questions/40991899/how-can-i-change-the-default-directory-of-the-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!