when i use command in ubuntu 16.04
sudo ionic run android
it gives error like
ANDROID_HOME environment veriables is not set
but when i use command
sudo -E ionic run android
its perfectly run without error, any one can answer this problem
when i use command in ubuntu 16.04
sudo ionic run android
it gives error like
ANDROID_HOME environment veriables is not set
but when i use command
sudo -E ionic run android
its perfectly run without error, any one can answer this problem
When you use sudo
it allows you to run commands with root privileges and it also uses root environment. Your ANDROID_HOME variable is set for the local user and not root.This throws error.
sudo -E
instructs sudo to use the current user environment which will pick up ANDROID_HOME.
Check this answer to fix permission issue for running ionic/cordova
commands.