Search code examples
androidtestingrubyminecalabashandroid-keystore

Keystore error when trying to run android calabash tests


I'm trying to run some calabash tests in RubyMine, to test a previously build .apk file.

When I try to run all features, the following error message pops up. I built the .apk file with AndroidStudio, not specifying a certain keystore, so I guess the "default" debug.keystore is used.

No MD5 fingerprint found:
  Keytool Error: java.lang.Exception: Keystore file does not exist: X:/.android/debug.keystore
java.lang.Exception: Keystore file does not exist: X:/.android/debug.keystore
  at sun.security.tools.KeyTool.doCommands(KeyTool.java:738)
  at sun.security.tools.KeyTool.run(KeyTool.java:340)
  at sun.security.tools.KeyTool.main(KeyTool.java:333)
(RuntimeError)

As far as I know the provided keystore for testing has to be the same as the one used when building the .apk, which should be the debug.keystore in my .android folder, since its the only one present on my computer.

I'm not sure why keytool tries to find the keystore file on the X:/ drive instead of the D:/ drive where the debug.keystoreexists.

Is there any way to tell keytool (or RubyMine) which keystore to use? Or may there be another problem I'm not aware of? Any hints or help would be appreciated.

Note: I was able to run the tests when using an older .apk. Only when I did some changes in the android code and build the app again the error occurred when trying to run the tests.


Solution

  • We try to autodetect the keystore. You can just use calabash-android setup to specify your keystore. Run the command from your test working directory.