Search code examples
command-lineterminalcommand-line-interfaceosx-snow-leopardandroid-virtual-device

Mac Terminal - How to start Android Virtual Device Manager on CLI?


I am currently developing a mobile web application and I don't have a test device yet so I'm using the to check the site. On my mac, I have installed the stand-alone Android SDK. Every time I want to use the AVD Manager, I have to execute the following on my terminal:

monitor

This command (being executed on the installed android sdk path) will open the Android Device Monitor and from here, I go to its menu bar and select Window Virtual Device Manager just to open the AVD Manager. So, is there a shortcut for that? I mean, i want to directly open the AVD manager via .


Solution

  • Use the Android SDK Tools:

    avdmanager
    

    Or you can also start it by using the command below but it's deprecated though on newer version. Before executing it, make sure to export your Android SDK's tools directory in your ~/.bash_profile (i.e. export PATH="/Users/user/Software/android-sdk-macosx/tools:$PATH")

    android avd
    

    Old answer:

    In order to open the manager on terminal, execute the following:

    /usr/bin/java -Xmx256M -XstartOnFirstThread \
     -Dcom.android.sdkmanager.toolsdir=/path/of/android-sdk-macosx/tools \
     -classpath /path/of/android-sdk-macosx/tools/lib/sdkmanager.jar:/path/of/android-sdk-macosx/tools/lib/swtmenubar.jar:/path/of/android-sdk-macosx/tools/lib/x86_64/swt.jar \
     com.android.sdkmanager.Main avd