Starting android emulator from your linux terminal

date
Nov 21, 2021
slug
start-android-emulator-from-linux-terminal
status
Published
tags
Emulator
Linux
Terminal
summary
type
Post
I was searching for a way to start the android emulator without opening the android studio first every time.
If you don't know what's your emulator's name, use this command first to check all the available emulator's name
emulator -list-avds
I had 2 images created, so got the following output
zap
bigo
Now if I want to use the zap named emulator I can use the following command.
emulator -v zap
or
emulator @zap
But what if you don't always want to keep that terminal window open? For that, I added the </dev/null &>/dev/null & options to run it in the background. I also added the -no-boot-anim so that I don't see the google boot animation every time I start the device.
emulator -avd zap -no-boot-anim </dev/null &>/dev/null &
Later I added this in my .zshrc file (add it to the .rc file specific to your shell) as an alias.
alias emu="emulator -avd zap -no-boot-anim </dev/null &>/dev/null &"
Now all I have to do is to run emu command in my terminal and the emulator boots up.
 
Some reference material
 

© Nikit Singh 2020 - 2021