RiyazsMacyo:LearnAlphabets riyazul$ calabash-android console $APK_FILE
irb(main):001:0> reinstall_apps
1459 KB/s (10725556 bytes in 7.178s)
1756 KB/s (556192 bytes in 0.309s)
nil
irb(main):002:0> start_test_server_in_background
RuntimeError: App did not start
from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:505:in `block in start_test_server_in_background'
from /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
from /Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'
from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:504:in `start_test_server_in_background'
from /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background'
from (irb):2
from /usr/bin/irb:12:in `<main>'
Below is the log i got when i tried to run directly using "run" command:
RiyazsMacyo:LearnAlphabets riyazul$ calabash-android run /Users/riyazul/Desktop/LearnAlphabets/bin/LearnAlphabets.apk
Feature: Login feature
Scenario: As a valid user I can log into my app # features/my_first.feature:3
802 KB/s (556192 bytes in 0.676s)
1623 KB/s (10725556 bytes in 6.452s)
App did not start (RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:505:in `block in start_test_server_in_background'
/Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
/Library/Ruby/Gems/2.0.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in `retriable'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:504:in `start_test_server_in_background'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background'
/Users/riyazul/Desktop/LearnAlphabets/features/support/app_life_cycle_hooks.rb:5:in `Before'
When I press "Login" # calabash-android-0.4.20/lib/calabash-android/steps/press_button_steps.rb:17
Then I see "Welcome to coolest app ever" # calabash-android-0.4.20/lib/calabash-android/steps/assert_steps.rb:5
HTTPClient::KeepAliveDisconnected (HTTPClient::KeepAliveDisconnected)
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:882:in `block in parse_header'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:97:in `timeout'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:875:in `parse_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:858:in `read_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:667:in `get_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1137:in `do_get_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1086:in `do_get_block'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `block in do_request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:986:in `rescue in protect_keep_alive_disconnected'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:980:in `protect_keep_alive_disconnected'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:774:in `request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:684:in `post'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:334:in `make_http_request'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:290:in `http'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:556:in `shutdown_test_server'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:97:in `shutdown_test_server'
/Users/riyazul/Desktop/LearnAlphabets/features/support/app_life_cycle_hooks.rb:12:in `After'
Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: As a valid user I can log into my app
1 scenario (1 failed)
2 steps (2 skipped)
0m52.142s
<uses-permission android:name="android.permission.INTERNET" />
Someone please help. :/
when i run this calabash-android console xyz.apk
it tries to sign it. However we have the apk which need to be signed on a specific keystore. so I have done the calabash-android setup to give the path of keystore, password and alias.
so resign done and apk moved to testserver.
when i start the calabash-android console xyz.apk and in the irb does the reinstall_apps and then start_test_server_in_background it gives the error as
RuntimeError: App did not start
from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:512:in `block in start_test_server_in_background'
from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:53:in `retriable'
from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:511:in `start_test_server_in_background'
from /Users/asinah-a/.rvm/gems/ruby-1.9.3-p550/gems/calabash-android-0.4.9/lib/calabash-android/operations.rb:92:in `start_test_server_in_background'
Also when manually checked in the android device , the app does not start .
You can try this way. Inside your ruby folder find file operations.rb. Path is like this "C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\calabash-android-0.7.3\lib\calabash-android". Open the file and find the block of code:
Retriable.retriable :tries => 100, :interval => 0.1 do
raise "App did not start" unless app_running?
Change "tries" parameter value on 300 instead of 100. It will help your app run in case of insufficiently productive device. We've tested 6 different devices with default settings, but only 2 flagship smartphones (Samsung galaxy S6) could run app with "tries" parameter value => 100. Now all our devices can run apps great!