Search code examples
bashandroid-studioterminalgit-clone

How to import project in Android Studio via terminal?


Can anyone give me advice how to import project to Android Studio via terminal (or if the option above is possible)?

Preconditions: One have process ID of started Android Studio (for example 9600) and project location (for example it is current location so one can use pwd).

Motivation: To automatize usage of git-cloned project within Android Studio IDE.


Solution

  • On Android Studio, navigate your menu bar to ..

    Tools > Create Command-line Launcher...

    A dialog will show up so you click ok and you are all set.

    From that you can do something like this to import cloned project from your terminal:

      $ git clone [email protected]:shaunkawano/AndroidProject.git 
      $ studio AndroidProject 
    

    Below is the reference I looked up to; although it is in Japanese it has screenshots and may help you more.

    http://qiita.com/takahirom/items/e9ad33e94140b09855c3

    I hope it helps.