Skip to content

Instantly share code, notes, and snippets.

@vemarav
Last active May 9, 2018 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vemarav/edd5f7082dbb52d3bf292612337a1144 to your computer and use it in GitHub Desktop.
Save vemarav/edd5f7082dbb52d3bf292612337a1144 to your computer and use it in GitHub Desktop.
Open android emulator from command line or Open android simulator from command line
  1. Paste the following scipt in your .bashrc file if they doesn't exist.
# ~/.bashrc

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
  1. Commands to paste the script
$ nano ~/.bashrc
$ # Now copy the three export commands
$ # paste them at the end of file
$ # press [ctrl + x] then [shift + y] then [enter]. 
$ source ~/.bashrc # reload the ~/.bashrc config
  1. Commands to open emulator
$ # List available avds using
$ $ANDROID_HOME/emulator/emulator -list-avds
$ # If no devices found open android studio and create one.
$ # In my case I have Nougat avd to launch it simply do
Nougat
$ $ANDROID_HOME/emulator/emulator @Nougat &
once it is launched press [ctrl + c]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment