Need help in calabash-android-build.rb for windows

134 views
Skip to first unread message

anoop jha

unread,
Aug 22, 2012, 12:20:29 PM8/22/12
to calabash...@googlegroups.com, karl....@gmail.com
Hi All,

I am working on running cucumber tests using calabash-android. I am getting errors while building the code. The error says " unable to find directory" in 
 calabash-android-build.rb file.

What shall I enter in "-Dtested.project.apk=\"#{app}\"",
when I write this as D:\mytestapp\test\bin\test.apk , the error is undefined symbol :\ <name error>
and if I write com.mytestapp.test.bin.test.apk , the error is uninitialised variable com.

Please help .

This is sample file
 ant_executable,
        "clean",
        "package",
        "-Dtested.package_name=#{package_name(app)}",
        "-Dtested.main_activity=#{main_activity(app)}",
        "-Dtested.project.apk=\"#{app}\"",
        "-Dandroid.api.level=#{api_level}",
        "-Dkey.store=\"#{File.expand_path keystore["keystore_location"]}\"",
        "-Dkey.store.password=#{keystore["keystore_password"]}",
        "-Dkey.alias=#{keystore["keystore_alias"]}",
        "-Dkey.alias.password=#{keystore["keystore_alias_password"]}",

My file
"-Dtested.package_name=#{com.src.liontest}",
 "-Dtested.main_activity=#{main_activity(app)}",//I copy the activity name from Eclipse console after running the emulator
"-Dtested.project.apk=\"#{app}\"",

Thanks and Regards, Anoop

Jonas Larsen

unread,
Aug 22, 2012, 12:22:53 PM8/22/12
to calabash...@googlegroups.com

Which version of Calabash are you using?

anoop jha

unread,
Aug 22, 2012, 12:30:16 PM8/22/12
to calabash...@googlegroups.com
I am not sure about the version, however this should be the latest one(sorry for this, pretty new to this) . I did all my set up recently.

Jonas Maturana Larsen

unread,
Aug 22, 2012, 1:00:21 PM8/22/12
to calabash...@googlegroups.com

You don't need to setup anything in build properties unless your app does some non-standard things.

anoop jha

unread,
Aug 22, 2012, 1:20:08 PM8/22/12
to calabash...@googlegroups.com
I read this carefully and followed all the instructions. I get this error message when I do calabash-android run <apk>.
The error says " unable to find directory" in calabash-android-build.rb file.

when i look at calabash-android-build.rb file all the parameters have default values and not the actual values. Then I opened this file in a ruby editor and changed the values. Then I run the code again. 
And getting the mentioned error.

Jonas Maturana Larsen

unread,
Aug 22, 2012, 1:23:42 PM8/22/12
to calabash...@googlegroups.com
Where do you find these files that you edit?

When you run "calabash-android run <apk>" do you replace <apk> with the path to the app you want to test?

anoop jha

unread,
Aug 22, 2012, 1:29:49 PM8/22/12
to calabash...@googlegroups.com
I find this file in Ruby193/gems/bin/calabash-androisd/..../bin/calabash-android-build.rb. This folder has all ruby files.
Also  I run  calabash-android run /pathtoproject/bin/test.apk.
Then this error is coming.

Jonas Maturana Larsen

unread,
Aug 22, 2012, 2:28:14 PM8/22/12
to calabash...@googlegroups.com
Please run "calabash-android run <apk> -v" with an unmodified calabash-android install and post the output here.

VishalCalabash

unread,
Aug 23, 2012, 2:43:28 AM8/23/12
to calabash...@googlegroups.com
Unable to start test server

Following are steps in followed to run apk : 
1. calabash-android gen -> generated structure, 
2. kept sudoku.apk in feature\support\Test.apk
3. execute command calabash-android setup 
4. Given key stroke n 
5. execute command calabash-android build . once i have executed i got error : BUILD SUCCESSFUL
Total time: 55 seconds
C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1515:in `stat': No such file or directory - C:/Users/M1014717/AppData/Local/Temp/d20120823-2228-rnrusc/test-server/bin/Test.apk (Errno::ENOENT)


Please help me in understanding which step i have missed to above.

Regards,
Vishal

Jonas Maturana Larsen

unread,
Aug 23, 2012, 2:57:14 AM8/23/12
to calabash...@googlegroups.com

You don't have to run calabash-android setup.
You app can be stored anywhere you want. (features/support/Test.apk is the test server and not your application)

Make sure you have the newest version of calabash-android by running:
gem update calabash-android
Reply all
Reply to author
Forward
0 new messages