Calabash console - start_test_server_in_background - android.util.AndroidException: INSTRUMENTATION_FAILED

1,234 views
Skip to first unread message

Brad Thompson

unread,
Apr 14, 2015, 1:28:06 PM4/14/15
to calabash...@googlegroups.com
I'm having an issue trying to run the following from the console:

calabash-android (0.5.5)

start_test_server_in_background

irb(main):002:0> start_test_server_in_background
android.util.AndroidException: INSTRUMENTATION_FAILED: org.wordpress.android/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
at dalvik.system.NativeStart.main(Native Method)

If I run shutdown_test_server and then try start_test_server_in_background again I get a diff message:

android.util.AndroidException: INSTRUMENTATION_FAILED: org.wordpress.android/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
at dalvik.system.NativeStart.main(Native Method)
RuntimeError: App did not start
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:609:in `block in start_test_server_in_background'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:608:in `start_test_server_in_background'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:125:in `start_test_server_in_background'
from (irb):4
from /Users/chthompson/.rvm/rubies/ruby-2.0.0-p451/bin/irb:12:in `<main>'

So it's really odd I see many people having similar issues online.  I have tried many things to get around this.  I am able to perform a calabash-android run
get the app running and then use console without having to start test server.

Someone must have encountered this issue before?

Thanks in advance,
Brad

ahmed alrawi

unread,
Apr 14, 2015, 3:38:37 PM4/14/15
to calabash...@googlegroups.com
try to do first     reinstall_apps and then start_test_server_in_background

Brad Thompson

unread,
Apr 14, 2015, 4:28:40 PM4/14/15
to calabash...@googlegroups.com
I just tried the following:

- Uninstall the app from the device
- Clear the test_servers folder
- Installed app via adb install app.apk
- From terminal:
-- bundle exec calabash-android console app.apk
-- reinstall_apps (no errors occur)
-- start_test_server_in_background

irb(main):002:0> start_test_server_in_background
android.util.AndroidException: INSTRUMENTATION_FAILED: org.wordpress.android/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
at dalvik.system.NativeStart.main(Native Method)
RuntimeError: App did not start
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:609:in `block in start_test_server_in_background'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:608:in `start_test_server_in_background'
from /Users/chthompson/.rvm/gems/ruby-2.0.0-p451/gems/calabash-android-0.5.5/lib/calabash-android/operations.rb:125:in `start_test_server_in_background'
from (irb):2

Brad Thompson

unread,
Apr 16, 2015, 11:33:36 AM4/16/15
to calabash...@googlegroups.com
Anyone seen this error? someone must have seen this if they have been using Calabash for awhile 

Brad Thompson

unread,
May 8, 2015, 5:07:48 PM5/8/15
to calabash...@googlegroups.com
I want to share my progress on this.  Seem this error sometimes happens but is device specific error.  Switching devices and I don't see this error anymore.  Idk what is wrong with this device as at one time it worked fine.

I'm also now seeing errors to do with permissions

Brad Thompson

unread,
May 11, 2015, 4:34:04 PM5/11/15
to calabash...@googlegroups.com
I'm having a great 1 on 1 discussion here but it seems I have found a way to get around seeing this error.  At first I would try to:

1) Delete everything in test_servers
2) Then try the calabash-android run command

I still see the issue listed above.  For me I have seen some success in doing the following:

1) ensure all packages of your test app are removed from phone.
2) Run the calabash-android console command
3) Run the reinstall_apps command
4) Run the start_test_server_in_background command

After this if you run the calabash-android run command it started working for me

tobias....@xamarin.com

unread,
May 12, 2015, 4:53:22 AM5/12/15
to calabash...@googlegroups.com, c.brad....@gmail.com
The error is often an indication that the app has not been installed. Have you removed the automatic reinstall from you run hooks?

Brad Thompson

unread,
May 12, 2015, 12:36:07 PM5/12/15
to calabash...@googlegroups.com, c.brad....@gmail.com
so my startup sequence is like this:

def start_test_server
  start_test_server_in_background

  #when app is first started and we are on the home screen we will run backdoor methods as needed.
  begin
    element_exists_with_timeout(HomePage::HOME_TRAIT) #wait for element on home screen to appear.
  rescue
    # ignored
  end

end

tobias....@xamarin.com

unread,
May 12, 2015, 12:47:41 PM5/12/15
to calabash...@googlegroups.com, c.brad....@gmail.com
If the app and the test-server is not installed, start_test_server_in_background fails
Reply all
Reply to author
Forward
0 new messages