2016-04-21 41 views
0

嘗試在物理設備上啓動.ipa文件時遇到困難。Calabash-ios在運行黃瓜時無法啓動.ipa文件

在控制檯中,我已經能夠啓動應用程序,並點擊不同的按鈕等,所以我想我已經正確設置了一切。我也將.ipa文件放在我從中運行黃瓜的目錄中。

[**********@calabash-sandbox]$ cucumber 
Feature: test Feature 

    Scenario: test Scenario   # features/test.feature:3 
    Recursively searched these directories to depth 5: 

    /Users/********/features 

    but could not find any .app for the simulator that links the Calabash iOS server. 

    Make sure you have built your app for a simulator target from Xcode. 

    If you are testing a stand-alone .app (you don't have an Xcode project), put 
    your .app in the same directory (or below) the directory you run `cucumber` from. 
    (RunLoop::NoSimulatorAppFoundError) 
    ./features/support/01_launch.rb:27:in `Before' 
    Given the app has launched  # features/test.feature:4 
    And I have done a specific thing # features/test.feature:5 
    When I do something    # features/test.feature:6 

Heading 
======= 

    Then something should happen  # features/test.feature:7 

Failing Scenarios: 
cucumber features/test.feature:3 # Scenario: test Scenario 

1 scenario (1 failed) 
4 steps (4 undefined) 
0m0.171s 

我使用的ipa文件是獨立的,不是通過xcode構建的。在應用和我的葫蘆,IOS版本的葫蘆框架的版本是一樣的0.19.0,

下面是01_launch.rb,這我相信是標準

require 'calabash-cucumber/launcher' 

# You can find examples of more complicated launch hooks in these 
# two repositories: 
# 
# https://github.com/calabash/ios-smoke-test-app/blob/master/CalSmokeApp/features/support/01_launch.rb 
# https://github.com/calabash/ios-webview-test-app/blob/master/CalWebViewApp/features/support/01_launch.rb 

module Calabash::Launcher 
    @@launcher = nil 

    def self.launcher 
    @@launcher ||= Calabash::Cucumber::Launcher.new 
    end 

    def self.launcher=(launcher) 
    @@launcher = launcher 
    end 
end 

Before do |scenario| 
    launcher = Calabash::Launcher.launcher 
    options = { 
    # Add launch options here. 
    } 

    launcher.relaunch(options) 
    launcher.calabash_notify(self) 
end 

After do |scenario| 
    # Calabash can shutdown the app cleanly by calling the app life cycle methods 
    # in the UIApplicationDelegate. This is really nice for CI environments, but 
    # not so good for local development. 
    # 
    # See the documentation for NO_STOP for a nice debugging workflow 
    # 
    # http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_STOP 
    # http://calabashapi.xamarin.com/ios/Calabash/Cucumber/Core.html#console_attach-instance_method 
    unless launcher.calabash_no_stop? 
    calabash_exit 
    end 
end 

不用說我是新到葫蘆,任何幫助將不勝感激

回答

0

爲了測試物理設備上的一個.ipa,你需要先在設備上安裝ipa。

我們在CalSmokeApp中有一些示例代碼,顯示如何使用ideviceinstaller在物理設備上安裝.ipa。

您還應該看到Testing on Physical Devices wiki頁面。

$ DEVICE_TARGET=<udid> \ 
    DEVICE_ENDPOINT=http://<ip>:37265 \ 
    BUNDLE_ID=com.example.MyApp \ 
    cucumber 
+0

感謝您的答覆,該.ipa文件被安裝在設備上,並且我已經能夠查詢不同的頁面並在應用程序中點擊不同的元素,問題是當試圖運行黃瓜文件時。 –

+0

在上面的步驟中,我的意思是使用黃瓜cmd的功能文件。我想我可能已經發現了這個問題,並且我想知道如果你能確認我是否正確朝着正確的方向前進。當ipa被構建時沒有正確的簽名,它被更改爲ios開發人員,然後我可以在控制檯和查詢中啓動應用程序。修改後的簽名直接部署到電話中。位於我的機器目錄中的ipa文件不包含正確的簽名,因爲必須創建工作區才能在正確的簽名中構建新的.ipa文件。 –

+0

道歉,如果我不清楚描述問題。我們的開發團隊已經通知我們,我們的構建環境總是會分配特定的簽名,並且必須創建一個解決方法,非常感謝 –

0

它的所有關於Xcode的,請確保您已通過建立的Xcode在模擬器上,如果已經顯示模擬器,然後運行黃瓜