In your bash terminal
code ~/.bashrc
Copy and paste the following code into the file. replace <userName>
with the your windows user name.
export ANDROID_SDK=/c/Users/<userName>/AppData/Local/Android/sdk
alias android-emulator="$ANDROID_SDK/emulator/emulator -avd $@"
alias android-list="$ANDROID_SDK/emulator/emulator -list-avds"
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
This is creating a command shortcut to:
- list available virtual devices
- launch the emulator for any virtual device you might specify
- launch the Pixel 2 emulator we created when setting up the environment
- create an environment variable with the path to the location of the android sdk
If you are not sure what your user name is run the following commands.
cd ~
pwd
You should see an output like
/c/Users/<userName>/
Run this command to make the shortcuts available in the terminal
source ~/.bashrc
Run this command shortcut to list available virtual android devices.
android-list
If it does not, update this line in .bashrc, and replace Pixel_2_API_28
with the value returned from android-list
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
if you had to update the line, run this command again.
source ~/.bashrc
Make sure that your emulator is closed, and android studio is closed. then in the terminal you can run
pixel2
To make sure that the bash_profile file is being loaded with each new terminal: Close the emulator. Open a new terminal. Run pixel2
In your bash terminal
code ~/.bash_profile
Copy and paste the following lines of code to the end of the file that just opened, and save the file.
alias android-emulator="$ANDROID_SDK/emulator/emulator -avd $@"
alias android-list="$ANDROID_SDK/emulator/emulator -list-avds"
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
This is creating a command shortcut to:
- list available virtual devices
- launch the emulator for any virtual device you might specify
- launch the Pixel 2 emulator we created when setting up the environment
Run this command make the shortcuts available in the current terminal. If the it was successful, there won't be any output.
source ~/.bash_profile
Next run this command shortcut to list available virtual android devices.`
android-list
If it does not, update this line in .bash_profile, and replace Pixel_2_API_28
with the value returned from android-list
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
If you had to update the line, run this command again.
source ~/.bash_profile
Make sure that your emulator is closed, and android studio is closed. then in the terminal you can run
pixel2
To make sure that the bash_profile file is being loaded with each new terminal: Close the emulator. Open a new terminal. Run pixel2
In your zsh terminal
code ~/.zshrc
Copy and paste the following lines of code to the end of the file that just opened, and save the file.
alias android-emulator="$ANDROID_SDK/emulator/emulator -avd $@"
alias android-list="$ANDROID_SDK/emulator/emulator -list-avds"
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
This is creating a command shortcut to:
- list available virtual devices
- launch the emulator for any virtual device you might specify
- launch the Pixel 2 emulator we created when setting up the environment
Run this command make the shortcuts available in the current terminal. If the it was successful, there won't be any output.
source ~/.zshrc
Next run this command shortcut to list available virtual android devices.`
android-list
If it does not, update this line in .zshrc, and replace Pixel_2_API_28
with the value returned from android-list
alias pixel2="android-emulator Pixel_2_API_28 -no-snapshot"
If you had to update the line, run this command again.
source ~/.zshrc
Make sure that your emulator is closed, and android studio is closed. then in the terminal you can run
pixel2
To make sure that the .zshrc file is being loaded with each new terminal: Close the emulator. Open a new terminal. Run pixel2