Search code examples
androidandroid-keystorecalabash-android

Could not list certificates in keystore. Probably because the password was incorrect


I am running calabash-android in a docker file and when I run the calabash test I got the error

/usr/local/bundle/gems/calabash-android-0.7.2/lib/calabash-android/java_keystore.rb:6:in `initialize': No such keystore file '/home/core/Android/debug.keystore' (RuntimeError)

I have tried this this and not working for me.

Edit

After setting up the path the error is like

/lib/calabash-android/java_keystore‌​.rb:32:in `initialize': Could not list certificates in keystore. Probably because the password was incorrect. (RuntimeError) 

Solution

  • It can be fixed by navigating to the /.android directory and remove the debug.keystore file if exist one and go try the command

    keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 
    

    And following that navigate to the directory where the feature files exist and setup the calabash android by using the command

    calabash-android setup
    

    The resign the new debug.keystore file using the command

    calabash-android resign <apk path>
    

    And finally we can run the test by using the command

    calabash-android run <apk path>