使用 calabash-android 时的 Android SDK 路径问题

标签 android android-sdk-tools calabash calabash-android

我在尝试运行 calabash-android 命令时收到“找不到 Android SDK 请确保已安装” 错误。我已经通过 brew 安装了 Android SDK。以下是我的 .bash_profile 的内容:

ANDROID_HOME=/usr/local/Cellar/android-sdk/24.2
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
PATH=$PATH:$ANDROID_HOME/build-tools

if [ -f ~/.bashrc ]; then
        source ~/.bashrc
fi

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

PATH=$PATH:/usr/local/apache-ant-1.9.4/bin
PATH=$PATH:/usr/local/share/npm/bin
JAVA_HOME=/usr/libexec/java_home

export PATH

这是我的 $PATH:

echo $PATH
/Users/mchumak/.rvm/gems/ruby-2.1.1/bin:/Users/mchumak/.rvm/gems/ruby-2.1.1@global/bin:/Users/mchumak/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/android-sdk/24.2/tools:/usr/local/Cellar/android-sdk/24.2/platform-tools:/usr/local/Cellar/android-sdk/24.2/build-tools:/Users/mchumak/.rvm/bin:/Users/mchumak/.rvm/bin:/opt/local/bin:/opt/local/sbin:/Users/mchumak/.rvm/bin:/usr/local/apache-ant-1.9.4/bin:/usr/local/share/npm/bin

“哪个机器人”产生:

/usr/local/bin/android

该特定文件的内容是:

#!/bin/bash
TOOL="/usr/local/Cellar/android-sdk/24.2/tools/android"
exec "$TOOL" "$@"

我可以很好地从命令行运行 Android SDK 管理器,它显示正确的 SDK 路径 (/usr/local/Cellar/android-sdk/24.2)。

我被难住了。知道为什么 calabash-android 找不到 SDK 吗?

最佳答案

这将解决您的问题,

  1. echo "export PATH=$PATH:/Users/#username/Library/Android/sdk/platform-tools/sdk/platform-tools/">> ~/.bash_profile

  2. 安装 android-platform-tools -> brew install android-platform-tools

- 还要确保您拥有管理员权限

关于使用 calabash-android 时的 Android SDK 路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30448086/

相关文章:

android - 使用首选项屏幕的主题

需要 Android Mediaplayer 播放/停止帮助

android - 升级到 Android Studio 2.3 后出现 "package android.support.multidex does not exist"

android - 如何确定电脑上安装的android SDK的版本?

android - 葫芦-android : `Cucumber::Ast` no longer exists

android - 如何加快calabash-android的查询速度

ios - Calabash 如何在 Ruby 方法中使用通配符?

php - 我的 .php/?PHPSESSID=xxxxxxxxxxxxxxxxxx 出现意外响应代码 500

java - 合并多个表中的一些记录后如何找出表名?

android - 如何解决android studio中任务 ':app:mergeDebugResources'的执行失败?