在设备上运行Cucumber,应用程序立即崩溃,错误:"写入fifo时出错。 RunLoop ::先进先出:: NoReaderConfiguredError"

时间:2015-12-02 11:17:26

标签: ios ruby cucumber calabash calabash-ios

所以我开始构建我的本地iOS设备环境。 我已经完全设置并运行了我的模拟器环境。 我已经通过iOS开发人员正确地为应用程序设置了我的分发和配置文件。 在尝试运行应用时,我按照以下步骤操作: 将我的iPhone 4s(iOS 8.4.1)与USB线连接到我的Mac。 使用以下命令在终端中搜索我的设备:

xcrun instruments -s devices

输出结果为:

Known Devices:
Oved's iMac [2E984C21-8F30-5B90-9844-C49F071F8433]
QA1 (8.4.1) [7640b16200d8c553efda3de85291253e95d229ce]
Apple TV 1080p (9.0) [336265EC-E047-4489-9896-03CB47382325]
iPad 2 (8.4) [12A95700-E253-4CF8-ADA7-D9BD4FBE51A9]
iPad 2 (9.0) [72D123E8-8140-41C6-B80C-31F8DA57DCB7]
iPad 2 (9.1) [7EAA1D9F-C4E7-4232-B754-B5FB10A29DDE]
iPad Air (8.4) [7210E244-F1E2-4BD5-92B6-F57E59B1D988]
iPad Air (9.0) [996AA70D-BFE2-48F3-AF96-98BAA453B43B]
iPad Air (9.1) [46D290BB-B89E-4F96-8134-BDE208EE793E]
iPad Air 2 (9.0) [8EA4A50B-D8A7-44C7-9E94-01DDDF3CC494]
iPad Air 2 (9.1) [77E90261-FB18-4B76-81C6-CDB5D5F0206D]
iPad Pro (9.1) [59474C51-4A80-433F-92FE-4A72E6324EFA]
iPad Retina (8.4) [4A4E0612-3BCC-4D09-9DFB-6CAEBD7A39FE]
iPad Retina (9.0) [BF1499FA-2399-48E0-94BC-D9CB92203656]
iPad Retina (9.1) [5DF2678B-AD5D-4C83-9BCF-500901E82A21]
iPhone 4s (8.4) [D130373E-9BD6-46BB-A119-4D0DB572E2EE]
iPhone 4s (9.0) [54C0853C-A2EB-4056-A6D1-69897F4E129E]
iPhone 4s (9.1) [13AEB071-8DB6-433F-9DEE-7354ACB5DD66]
iPhone 5 (8.4) [764C88BF-6E68-4EFA-B4F3-43CECE650D83]
iPhone 5 (9.0) [A6330DF5-1234-45E4-9C50-8360AD277133]
iPhone 5 (9.1) [E1B14CC6-33AA-430C-8C7D-33285F1854C5]
iPhone 5s (8.4) [0A271188-66AB-45F3-97A9-551EAD033509]
iPhone 5s (9.0) [BDD8A84E-1193-4945-9D75-7C812303BA61]
iPhone 5s (9.1) [F540230C-6CA3-4AC5-83C5-08646A14DBD3]
iPhone 6 (8.4) [60724F5F-F91E-4358-B02C-C3BFFC4E0D45]
iPhone 6 (9.0) [159105BB-0C5B-471A-B0B3-C0F29433D7FC]
iPhone 6 (9.1) [BD8D0506-AD7D-44DE-861F-31AE875540D3]
iPhone 6 Plus (8.4) [0FD52166-86F3-4A42-9B60-0BC4F0AB229F]
iPhone 6 Plus (9.0) [B869364C-9BD4-40EA-B856-E92733256F90]
iPhone 6 Plus (9.1) [76CB8D84-A43C-47EC-ADAB-27AAAFA1EC35]
iPhone 6s (9.0) [AC299644-A221-4258-B61E-98D4C5E2DB01]
iPhone 6s (9.1) [90B8A72B-B98D-497F-B4EE-D3B57B6B4D0B]
iPhone 6s (9.1) + Apple Watch - 38mm (2.0) [6D03FF30-74B9-4DD1-A90B-309353F74B49]
iPhone 6s Plus (9.0) [1D797C85-8848-470B-A0AC-42D081BE2DBF]
iPhone 6s Plus (9.1) [96622DF5-2F94-40F4-9C0C-D30ADF3F0ECB]
iPhone 6s Plus (9.1) + Apple Watch - 42mm (2.0) [D428E666-334B-423A-806B-6775FF8FE7BA]

我的物理设备称为QA1。

我的下一步是在Xamarin上构建和编译我的应用程序以进行测试。 我在查找程序中搜索了.ipa文件,将其扩展名为.zip,然后可以看到我的.app文件。 我在此命令中将.app文件导出为我的应用程序包路径:

export APP_BUNDLE_PATH="/Users/roishmueli/Mekomi/Mekomi/Mekomi/iOS/bin/iPhone/Testing/2.821/Mekomi/Payload/MekomiiOS.app"

然后我解锁了我的设备,并运行此命令在设备上运行应用程序:

DEBUG=1 BUNDLE_ID="com.kimaia.mekomi" DEVICE_TARGET="7640b16200d8c553efda3de85291253e95d229ce" DEVICE_ENDPOINT=http://192.168.1.40 cucumber

DEBUG=1为我提供了额外的输出,即:

/Users/roishmueli/Mekomi/Mekomi/Mekomi/features/step_definitions/calabash_steps.rb:7: warning: Insecure world writable dir /Android/android-sdk-macosx in PATH, mode 040757

Feature: Login

  Scenario: Registration              # features/1-FirstPage.feature:3

INFO: Using uia strategy: 'host'
DEBUG: Searching for run-loop results with glob: /Users/roishmueli/.run-loop/results/*
DEBUG: Found 6 previous run-loop results
DEBUG: Will delete 1 previous run-loop results
DEBUG: Deleted 1 previous results in 0.001425 seconds
DEBUG: Searching for instruments caches with glob: /Library/Caches/com.apple.dt.instruments/xrtmp__*
DEBUG: Found 5 instruments caches
DEBUG: Will delete 0 instruments caches
DEBUG: Deleted 0 instruments caches in 0.00014 seconds
2015-12-02 11:50:55 +0200 [RunLoop:debug]: 
{
                        :app => "com.kimaia.mekomi",
                       :args => [],
    :bundle_dir_or_bundle_id => "com.kimaia.mekomi",
                  :bundle_id => "com.kimaia.mekomi",
                     :device => "com.kimaia.mekomi",
              :device_target => "7640b16200d8c553efda3de85291253e95d229ce",
                :instruments => #<Instruments 7.1.1>,
              :launch_method => :instruments,
             :launch_retries => 5,
                   :log_file => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/run_loop.out",
                  :no_launch => false,
                    :no_stop => false,
         :relaunch_simulator => true,
                      :reset => false,
                :results_dir => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55",
          :results_dir_trace => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/trace",
                     :script => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/_run_loop.js",
                :sdk_version => nil,
                       :udid => "7640b16200d8c553efda3de85291253e95d229ce",
               :uia_strategy => :host,
                      :xcode => "7.1.1",
                 :xcode_path => "/Applications/Xcode.app/Contents/Developer"
}
EXEC: xcrun instruments -s templates

Starting on 7640b16200d8c553efda3de85291253e95d229ce App: com.kimaia.mekomi 
2015-12-02 11:50:56 +0200 [RunLoop:debug]: xcrun instruments -w 7640b16200d8c553efda3de85291253e95d229ce -D /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/trace -t Automation com.kimaia.mekomi -e UIARESULTSPATH /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55 -e UIASCRIPT /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/_run_loop.js >& /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/run_loop.out
2015-12-02 11:50:56 +0200 [RunLoop:debug]: Preparation took 0.877732 seconds

然后我每30秒就得到一次:

2015-12-02 11:51:26 +0200 [RunLoop:debug]: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
2015-12-02 11:51:26 +0200 [RunLoop:debug]: Failed to launch. Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError

我得到这些日志5次,然后这条消息超时:

Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
  Calabash::Cucumber::Launcher::StartError: 

  "Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.

  Logfile: /Users/roishmueli/.run-loop/results/2015-12-03_10-58-35/run_loop.out

  2015-12-03 10:58:37.013 instruments[86757:6604129] Failed to start Instruments daemon on 'QA1 (8.4.1)' (The service is invalid.)
  Instruments Usage Error : Specified target process is invalid: com.kimaia.mekomi
  instruments, version 7.1.1 (59040)
  usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]


   (Calabash::Cucumber::Launcher::StartError)
  /Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:778:in `new_run_loop'
  /Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:635:in `relaunch'
  /Users/roishmueli/Mekomi/Mekomi/Mekomi/features/support/01_launch.rb:27:in `Before'
    Then I see the first page         # features/step_definitions/calabash_steps.rb:13
    Then I press on the verify button # features/step_definitions/calabash_steps.rb:23

Failing Scenarios:
cucumber features/1-FirstPage.feature:3 # Scenario: Registration

1 scenario (1 failed)
2 steps (2 skipped)
2m35.735s

我已通过开发人员设置和instruments.app在我的设备上启用了我的UIAutomation。 我尝试了多个不同的APP_BUNDLE_PATH,但似乎都没有解决这个问题。 我错过了什么? 提前谢谢。

1 个答案:

答案 0 :(得分:1)

+100表示​​良好的报告。

  

APP_BUNDLE_PATH =&#34; /Users/roishmueli/Mekomi/Mekomi/Mekomi/iOS/bin/iPhone/Testing/2.821/Mekomi/Payload/MekomiiOS.app"

在针对物理设备进行测试时,您不需要设置APPAPP_BUNDLE_PATH;它会被忽略。此外,我想确保您了解此.app仅适用于物理设备;你不能在模拟器上使用这个.app。

.ipa是否安装在目标设备上?我的猜测不是,这就是这个错误的原因。 Calabash iOS无法在设备上安装ipas。

以下是您需要了解的有关在物理设备上进行测试的所有信息的链接。

要了解有关环境变量的更多信息,请参阅API Documentation

如果您有.app并且需要生成.ipa,我们建议您使用xcrun ditto - here is an example