Unable to start emulator from command line

PressRex profile image
by PressRex
Unable to start emulator from command line

I am trying to run the below shell script:

#!/usr/bin/env bash

sdkmanager "emulator" "system-images;android-28;google_apis_playstore;x86_64"
echo no | avdmanager create avd -n "Android" -k "system-images;android-28;google_apis_playstore;x86_64" --device 'Nexus 6P'
$ANDROID_HOME/tools/emulator -avd Android -no-audio -no-boot-anim -no-snapshot -timezone Asia/Phnom_penh

I have added the ANDROID_HOME, ANDROID_AVD_HOME to my PATH (Note: I am using macos with zsh) and i have sourced the zshrc file and also restarted the terminal but keep getting the below error:

./start_emulator.sh: line 3: sdkmanager: command not found

./start_emulator.sh: line 4: avdmanager: command not found

PANIC: Unknown AVD name [ANDROID], use -list-avds to see valid list. ANDROID_AVD_HOME is defined but there is no file Android.ini in $ANDROID_AVD_HOME/.android/avd (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/avd, and $HOME/.android/avd)

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More