1

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

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
ShahAli
  • 36
  • 4

1 Answers1

1

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.

Community
  • 1
  • 1
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103