Home » Android » Android SDK path issue when using calabash-android

Android SDK path issue when using calabash-android

Posted by: admin May 14, 2020 Leave a comment


I’m getting a “Could not find an Android SDK please make sure it is installed” error when trying to run calabash-android commands. I’ve installed the Android SDK via brew. Here are the contents of my .bash_profile:


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

[[ -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*


export PATH

Here’s my $PATH:

echo $PATH
/Users/mchumak/.rvm/gems/ruby-2.1.1/bin:/Users/mchumak/.rvm/gems/[email protected]/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

“which android” produces:


The contents of that particular file are:

exec "$TOOL" "[email protected]"

I can run the Android SDK Manager from the command line just fine, and it shows the correct SDK path (/usr/local/Cellar/android-sdk/24.2).

I’m stumped. Any ideas why calabash-android can’t find the SDK?

How to&Answers:

This will fix your issue,

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

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

– Also ensure yourself have admin rights


Looking at your $PATH output seems like android sdk path isnt loaded into PATH. Add below to your .bash_profile



calabash-android run /Users/marcg/Downloads/app-news.apk

I received that following error

Could not find any platform directory in ‘/Users/marcg/Library/Android/sdk/platforms’

I corrected this with the symlink below:

platforms$ ln -s ../platform-tools/ platform

I ran again and get an error that the android jar was missing from a standard directory of /Users/marcg/Library/Android/sdk/platforms

I then copied that android.jar to this platforms dir

Dir now looks like:

us164912:platforms marcg$ ls -l
total 49640
-rwxr-xr-x   1 marcg Users  25409822 Oct  5 09:26 android.jar
lrwxr-xr-x   1 marcg Users        18 Oct  5 09:14 platform -> ../platform-tools/

Still getting

Did not find ‘android.jar’ in any standard directory of ‘/Users/marcg/Library/Android/sdk/platforms’. Calabash will therefore take longer to load

I copied the android.jar to the platform-tools directory and remaining error went away.

Steps to correct:

  1. Make a symlink in platforms that points to platform-tools
    ln -s ../platform-tools/ platform
  2. Copy the android.jar to the platform-tools dir

Would be better if the framework allowed you configure via file or additional env vars where to find each of these. My earlier attempt to set ANDROID_HOME to the platform-tools dir didn’t work and why I did a symlink.