i trying run hybrid app on android phone using ionic using following command:
sudo ionic run android
however keep receiving error :
error: failed find 'android_home' environment variable. try setting setting manually. failed find 'android' command in 'path'. try update 'path' include path valid sdk directory.
i have added platform tools & tools path updated android_home point sdk root.
the android_home environment variable shows when run env , path has tools , platform tools too. additionally can execute android too. launches sdk manager expected.
details:
android_home: /home/user/android/sdk $path: /home/user/android/sdk/tools:/home/user/android/sdk/platform-tools
please help! driving me wall!
credit goes @heemayl on askubuntu.
https://askubuntu.com/a/783805/247116
sudosanitizes environment , default keeps environment variables available modifying values of (e.g. path).you can pass variable android_home manually:
sudo android_home="/actual/path" ionic run android
or preserve current environment:
sudo -e ionic run android