If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location. You may also want to add it to your PATH environment variable. code example
Example: windows 10 change ANDROID_HOME
For Windows:
set ANDROID_HOME=C:\ installation location \android-sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools