Search code examples
javaandroideclipseenvironmentcalabash

Not able to build Android calabash environment on windows


For building the environment I've installed/use OS Windows 8.1, eclipse, Android SDK, JDK, ruby installer, DevKit installed. Also I've set path for ANDROID_HOME, JAVA_HOME. I've tried maximum ways to resign JAR but not getting that jar so I'm stuck at the point and unable to move forward. did google for my problem. Now I got confused what will be step by step execution to make my environment to run? Or shall I need to build this structure on Linux to make it easier run?


Solution

  • First open 'CMD' or 'CMD with Ruby'

    Run the following command

    cucumber --version
    

    if cmd shows cucumber version, proceed to next step

    calabash-android version
    

    if cmd show calabash-android version, you're ready to run calabash-android testcase.

    Then create a folder, cd to that folder and run these commands.

    $ calabash-android gen  #this will create folder structure
    $ calabash-android resign apk_path/<apkfile.apk>
    $ calabash-android build apk_path/<apkfile.apk>
    $ calabash-android console apk_path/<apkfile.apk>
    

    You will see interactive ruby editor, now type the following command

    $ start_test_server_in_background  # app will install in connected device.
    

    Then

    $ query("*")
    

    Now you can see all the elements in your android application!!

    If you face any error/issue in any steps, your setup may be incomplete.