Android_windows下安裝calabash-android(1)

來源:互聯網
上載者:User

在windows下安裝calabash-android,步驟如下:
1. 參考https://github.com/calabash/calabash-android/wiki
2. 從git上下載calabash-android後,首先需要安裝ruby,我安裝的是ruby 2.0.0p0
3. 下載calabash-android-demoapp,安裝測試時用的 android工程
4. 安裝calabash-android: gem install calabash-android
5. 安裝gem,cucumber, DevKit(DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe)

http://www.hoowolf.net/2011/10/01/install-cucumber-on-windows/

6.在android工程目錄下運行calabash-android run ../bin/AndroidDemoPeoject.apk出現錯誤如下:
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansic
on/) to get coloured output on Windows
WARNING: cannot load such file -- 2.0/gherkinlexeren
Couldn't load 2.0/gherkinlexeren
The $LOADPATH was:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.2.5/bin/../lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/builder-3.2.0/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/diff-lcs-1.2.2/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/multi
json-1.7.2/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/gherkin-2.11.7-x86-mingw32/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.2.5/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/retriable-1.3.3/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/slowhandcuke-0.0.3/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rubyzip-0.9.9/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/awesomeprint-1.1.0/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/calabash-android-0.4.3/lib
C:/Ruby200/lib/ruby/site
ruby/2.0.0
C:/Ruby200/lib/ruby/siteruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/site
ruby
C:/Ruby200/lib/ruby/vendorruby/2.0.0
C:/Ruby200/lib/ruby/vendor
ruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/vendor_ruby
C:/Ruby200/lib/ruby/2.0.0
C:/Ruby200/lib/ruby/2.0.0/i386-mingw32. Reverting to Ruby lexer.
6.1解決方案:
You need to

Download Ansicon from https://github.com/adoxa/ansicon/downloads and unzip it into a directory with no spaces

Use a cmd prompt and navigate to where you unzipped it.
CD into the x64 directory (unless you have a 32bit machine, then use the x86 one)
Type ansicon.exe –i
Open a new cmd prompt
6.2 繼續執行calabash-android run ../bin/AndroidDemoProject.apk,出現問題如下:
WARNING: cannot load such file -- 2.0/gherkinlexeren
Couldn't load 2.0/gherkinlexeren
The $LOAD_PATH was:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/cucumber-1.2.5/bin/../lib
7. 安裝bundler, gem install bundler,bundle install會出現如下錯誤:
Bundler::GemfileNotFound
8.安裝Pik (pik is a tool to manage multiple versions of ruby on Windows)



/////////////////////////////////////////////////////////////////
在windows下的完整操作步驟如下:
1. 安裝git,並下載calabash-android,然後在calabash-android目錄下安裝calabash-android,首先需要安裝gem, gem install calabash-android
2. 安裝ruby 1.9.3,不要安裝ruby 2.0,我安裝後出現以上的錯誤無法解決。
3. 下載AndroidDemoProject,然後在eclipse下匯入工程並運行安裝到模擬器上,此時的簽名為debug.keystore,然後切換到calabash目錄下,執行命令calabash-android setup,然後設定keystore,密碼與alias_name,設定完成後就OK了
4. 執行命令calabash-android run ../bin/AndroidDemoProject.apk,這樣就開始執行操作了哦。
執行結果如下:
AndroidDemoProjectcalabash>calabash-android run ../bin/AndroidDemoProject.apk
Feature: Demo feature



Scenario: I can start my app # featuresmyfirst.feature:3
433 KB/s (528373 bytes in 1.189s)
95 KB/s (37643 bytes in 0.385s)
* I wait for "Hello World, AndroidDemoProject" to appear # calabash-android-
0.4.3/lib/calabash-android/steps/progress
steps.rb:27
1 scenario (1 passed)
1 step (1 passed)
0m52.711s

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.