Getting “App did not start (RuntimeError)” when trying to run calabash-android tests on device

可紊 提交于 2019-12-06 03:47:10

问题


I'm trying to run an small initial set of calabash-android tests on a Samsung Galaxy S3 connected to a Windows 7 laptop and keep getting an "App did not start (RuntimeError)" when trying to start the test server.

I've got Ruby v1.9.3p448, RubyDevKit 4.5.2 (32-bit), Ant 1.9.2, and AnsiCon installed. I've installed calabash-android 0.4.20 and all its dependent gems by typing "gem install calabash-android" at the command prompt. I've created a signed APK using Xamarin Studio and the release keystore. My initial feature set of six steps is parsed correctly when run with the --dry-run flag.

When I type "calabash-android run com.XYZ.ABC.apk --verbose the following things happen:

  1. No test server exists for the app/calabash so a new test server is created and signed with the same keystore as the APK
  2. The feature files are parsed successfully.
  3. The test server com.XYZ.ABC.test is uninstalled successfully.
  4. The app com.XYZ.ABC.apk is uninstalled successfully.
  5. The test server created in step #1 is installed successfully.
  6. The app com.XYZ.ABC.apk is installed successfully.
  7. The test server is started.

At this point we get the "App did not start (RuntimeError)" message. Here's the appropriate detail from the command line.

2014-03-11 08:10:05 - Starting test server using:
2014-03-11 08:10:05 - "C:\Users\BMaya\AppData\Local\Android\android-sdk/platform-tools/adb.exe" -s 4df18df165d46f4d shell am instrument -e target_package com.trimble.terraflex -e main_activity trimble.tfm.fieldapp.SplashActivity -e test_server_port 7102 -e debug false -e class sh.calaba.instrumentationbackend.InstrumentationBackend com.trimble.terraflex.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
App did not start (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:505:in `block in start_test_server_in_background'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:in `perform'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:53:in `retriable'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:504:in `start_test_server_in_background'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background'

I've also tried running the tests from the Ruby command prompt with the same results:

  1. Type "calabash-android console com.XYZ.ABC.apk" at the DOS Command Prompt
  2. Type "reinstall_apps" at the Ruby command prompt.
  3. Type "start_test_server_in_background" at the Ruby command prompt.

I've googled around and tried the following things:

  1. Make sure Internet was selected in the app manifest (it was) - http://bit.ly/NGK0B8
  2. Manually resigned the app (didn't help) - http://bit.ly/NGKg2Z
  3. Uninstalled calabash-android 0.4.20 and re-installed (didn't help) - http://bit.ly/1dLTlBt
  4. Signed the APK with the debug keystore instead of the release keystore (didn't help)
  5. Tried the sample app and running from the console (got same error) - http://bit.ly/OhaV6z, http://bit.ly/Ohb8GR
  6. Checking to make sure port 7102 was not blocked by any other application or system service (it wasn't).

Any help is appreciated. Let me know if you need more info.

Thanks in advance.


回答1:


I was facing the same issue. After days of looking for a solution, I found that the proxies on my machine was causing the issue. Check if you have proxies set on your machine. Go to Terminal if you are on Mac and execute the below statement to unset the proxies export http_proxy=""




回答2:


You probably have found a solution till now. I am posting this to help others. These are the exact same problems that I was seeing and I was getting the error just like the OP. My issue was due to the fact that I was using a wrong apk file! I had a couple different versions of apk files in the same folder and I was using the wrong one with calabash-android run command.



来源:https://stackoverflow.com/questions/22330013/getting-app-did-not-start-runtimeerror-when-trying-to-run-calabash-android-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!