Calabash Android: sh: /platform-tools/adb: No such file or directory error message

676 views
Skip to first unread message

Brad Thompson

unread,
Jul 25, 2014, 2:04:08 AM7/25/14
to calabash...@googlegroups.com
Hi everyone,

I'm so close to getting this working.  I have the x-platform example running perfect on IOS but now I want to get it running on android.  I have a real device plugged in.  I'm not sure if it's needed but I have added the following two lines:

export ANDROID_HOME=/Users/chthompson/Library/adt-bundle-mac-x86_64-20140702/sdk

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

to my .profile but when I try to run my tests from terminal with "bundle exec cucumber -p android" I get the following error:

first error I got was:

sh: /platform-tools/adb: No such file or directory

I also sometimes see error:

Scenario: Invalid Login              # features/login.feature:4

W/asset   (  667): Asset path  is neither a directory nor file (type=1).

ERROR: dump failed because assets could not be loaded

 'package' not found in aapt output (RuntimeError)

Any ideas what could be causing this issue? Thanks in advance


Brad

Brad Thompson

unread,
Jul 25, 2014, 4:59:07 PM7/25/14
to calabash...@googlegroups.com
Ok I believe this is because I'm not pointing my tests to an .apk file.  I noticed in the android/support we have a file "app_life_cycle_hooks.rb" which has the following in it:

Before do |scenario|
  scenario_tags = scenario.source_tag_names
  if scenario_tags.include?('@reinstall') || !INSTALLATION_STATE[:installed]
      uninstall_apps
      install_app(ENV['TEST_APP_PATH'])
      install_app(ENV['APP_PATH'])
      INSTALLATION_STATE[:installed] = true
  end

  start_test_server_in_background
end

So do I actually have to set an environment variable on my machine to make this work? Can I not just point it to the .apk in my yml file?

Thanks,
Brad


Brad Thompson

unread,
Jul 25, 2014, 6:17:12 PM7/25/14
to calabash...@googlegroups.com
kind of funny I'm just simply replying to myself but hopefully someone sees this thread and can chime in.  I'm erroring out in the calabash-android/helpers.rb file

def package_name(app)
  package_line = aapt_dump(app, "package").first
  raise "'package' not found in aapt output" unless package_line
  m = package_line.match(/name='([^']+)'/)
  raise "Unexpected output from aapt: #{package_line}" unless m
  m[1]
end

The red line is what is erroring out so I guess I don't pass an app name or something. In my yml file my android profile is as follows:

android: PLATFORM=android -r features/support -r features/android -r features/step_definitions

Do I need an "APP" config here or something?


Jani Jegoroff

unread,
Jul 26, 2014, 3:10:50 PM7/26/14
to calabash...@googlegroups.com
For me your launch command looks wrong. AFAIK you need to give .apk as parameter in launch command:

calabash-android run app.apk

Also see x-platform instructions for Android: https://github.com/calabash/x-platform-example#android

Brad Thompson

unread,
Jul 27, 2014, 4:03:15 PM7/27/14
to calabash...@googlegroups.com
That was it thanks.  I thought I could just type 

bundle exec cucumber -p android but I had to type:

bundle exec calabash-android run appsUnderTest/Android-debug.apk -p android

Works perfect thanks for your help :)

sahiti ch

unread,
Apr 10, 2015, 6:05:23 AM4/10/15
to calabash...@googlegroups.com
Hi 

I am getting this error when I am running the tests on RubyMine IDE and when I run the tests in Terminal, all seems to be OK. Can't figure out what went wrong. Tests were running before and suddenly this morning started failing with this error on rubymine IDE.

/Users/xyz/.rvm/rubies/ruby-1.9.3-p448/bin/ruby -EUTF-8 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/chittmos/.rvm/gems/ruby-1.9.3-p448/bin/cucumber /Users/xyz/nowtv-android-app/Calabash/features/entertainment.feature --format Teamcity::Cucumber::Formatter --expand --name "^Featured tab has a hero image$" --color -r features
Testing started at 11:02 ...

sh: /platform-tools/adb: No such file or directory

NoMethodError: undefined method `+' for nil:NilClass
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:548:in `connected_devices'
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:514:in `default_serial'
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:273:in `initialize'
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:49:in `new'
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:49:in `default_device'
/Users/xyz/.rvm/gems/ruby-1.9.3-p448/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:104:in `uninstall_apps'


Can somebody please help me?

Thanks

Brad Thompson

unread,
Apr 14, 2015, 5:13:20 PM4/14/15
to calabash...@googlegroups.com
are you able to debug from RubyMine?  this would be the best way to find issue.

sahiti chittimotu

unread,
Apr 15, 2015, 4:20:38 AM4/15/15
to calabash...@googlegroups.com
Thanks... This issue is sorted out now. That morning I restarted my mac in Verbose mode, that might have messed up my path and couldn't find adb tools. When I restarted my machine again problem sorted out.


Thanks
Sahiti

--
You received this message because you are subscribed to a topic in the Google Groups "calabash-android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/calabash-android/0xHF9u98J-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to calabash-andro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

muneer muhammed

unread,
Apr 5, 2016, 6:14:47 AM4/5/16
to calabash-android
Hi, I am getting the below error when I try to run the calabash-android. 
/usr/local/android-sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/usr/local/bundle/gems/calabash-android-0.7.2/lib/calabash-android/helpers.rb:18:in `package_name': 'package' not found in aapt output (RuntimeError)
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android-build.rb:42:in `block (2 levels) in calabash_build'
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android-build.rb:38:in `chdir'
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android-build.rb:38:in `block in calabash_build'
from /usr/local/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android-build.rb:37:in `calabash_build'
from /usr/local/bundle/gems/calabash-android-0.7.2/lib/calabash-android/helpers.rb:106:in `build_test_server_if_needed'
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android-run.rb:16:in `calabash_run'
from /usr/local/bundle/gems/calabash-android-0.7.2/bin/calabash-android:84:in `<top (required)>'
from /usr/local/bundle/bin/calabash-android:22:in `load'
from /usr/local/bundle/bin/calabash-android:22:in `<main>'


Can anyone please tell me why it is coming like that ?

Joshua Moody

unread,
Apr 5, 2016, 6:18:01 AM4/5/16
to calabash-android
Muneer,

I answered your question on Stack Overflow.

Please do not cross post. The same people monitor all of the public channels.

jjm
Reply all
Reply to author
Forward
0 new messages