I love Git for Windows. It's just easy to move between Linux, Mac and Windows if I use the same tools.
Today I was wondering, how can I use bash from the terminal in Android Studio?
I ran into a blog post that explains how to do the same thing with Cygwin.
Since the Cygwin and git for Windows are similar I decided to give it a shot. Here are the steps:
-
Create
Bash-AndroidStudio.bat
included in this gist. -
@echo off set IDE=AndroidStudio "C:\Program Files\Git\bin\bash.exe"
-
Add the following to your
.bashrc
file -
if [ ! -z "${IDE}" -a "${IDE}" == "AndroidStudio" ]; then cd $OLDPWD; fi
-
In Android Studio, go to settings and add the path to your batch file in Tools > Terminal > Shell path.
Open a new terminal... voila!
@AllenVork, if your 'bash.exe' is in "C:\Program Files\Git\bin\bash.exe", then the .bashrc file can be found at: "C:\Program Files\Git\etc\bash.bashrc".