我按照本教程在 Ubuntu 上安装 phonegap,一切正常,我什至能够运行模拟器。
但是当我试图在它上面运行我的 phonegap 项目时,我得到了这个错误:
[phonegap] executing 'cordova emulate android'...
cp: no such file or directory: /home/abdessalem/Documents/test/icon.png
Running command: /home/abdessalem/Documents/test/platforms/android/cordova/run --emulator
ERROR: Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
Error: /home/abdessalem/Documents/test/platforms/android/cordova/run: Command failed with exit code 2
正如文章所说,我将环境变量添加到~/.profile
export ANDROID_HOME="/usr/local/android-sdk-linux"
export ANDROID_PLATFORM_TOOLS="/usr/local/android-sdk-linux/platform-tools"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
我怎样才能解决这个问题 ?