简体   繁体   English

Calabash-ios:在没有xcodeproj的情况下运行安装了ipa的测试物理设备

[英]Calabash-ios: Run test physical device installed ipa without xcodeproj

I am new with calabash-ios and have a dummy question is: 我是calabash-ios的新手,有一个虚拟问题是:

How possibly could I run a calabash test with real device which have installed ipa file (included calabash framework) and without xcodeproj? 我怎么可能在没有安装xpaproj的实际设备上安装了ipa文件(包括calabash框架)运行calabash测试?

Problem is I am doing QA and Dev only gives me ipa file to test without source code. 问题是我正在执行质量检查,开发人员只给了我ipa文件进行测试,而没有源代码。

UPDATE: I am able to run the ipa file in console and cucumber by adding BUNDLE_ID. 更新:通过添加BUNDLE_ID,我可以在控制台和黄瓜中运行ipa文件。 And make sure the CFNetwork.framework is including in app framework to establish the connection. 并确保CFNetwork.framework包含在应用程序框架中以建立连接。

But I got another problem to run the scenario: 1. When I run the command below: 但是运行该方案时我遇到了另一个问题:1.运行以下命令时:

DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID cucumber

Then I got this error: 然后我得到了这个错误:

 A JSON text must at least contain two octets! (JSON::ParserError)
  features/my_first.feature:8:in `Then I touch "LOG-IN/ CREATE ACCOUNT"'

all other steps was skipped 其他所有步骤均被跳过

  1. Then I run the console code 然后我运行控制台代码

     DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID calabash-ios console 

Then I run server_version I got reply back that said connection SUCCEED But when I run start_test_server_in_background It took me too long to wait and I see the app my physical device kept crashed and launch again and again until it stop as: 然后我运行server_version我得到了回复,说连接成功。但是当我运行start_test_server_in_background时,我花了很长时间等待,我看到该应用程序的物理设备一直崩溃,并一次又一次启动,直到它停止为:

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

"Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
 2015-10-01 10:49:41.634 instruments[15640:10558880] WebKit Threading Violation - initial use of WebKit from a secondary thread.
 2015-10-01 10:49:42.574 instruments[15640:10558978] Attempting to change event horizon while disengage
 2015-10-01 10:49:42.577 instruments[15640:10558877] Attempting to change event horizon while disengage
 Instruments Trace Error : Target failed to run: Permission to debug app

Anyone can help please! 任何人都可以帮忙! I tried to search some solution but they almost issue on simulator and they contain xcodeproj. 我尝试搜索一些解决方案,但它们几乎在模拟器上出现问题,并且包含xcodeproj。 As a QA, I dont have the source code, only .ipa file. 作为质量检查人员,我没有源代码,只有.ipa文件。 :( Thanks :( 谢谢

You should set 3 variables: 您应该设置3个变量:

$ DEVICE_TARGET=<UDID> \
    DEVICE_ENDPOINT=http://<ip>:37265 \
    BUNDLE_ID=com.example.YourApp cucumber

The device and the host computer should be on the same network. 设备和主机应位于同一网络上。

The .ipa must be installed on your device. .ipa必须安装在您的设备上。

You can do this in Xcode by dragging-and-dropping in the Device Manager window or with a third-party tool like ideviceinstaller (available with homebrew). 您可以在Xcode中通过在“设备管理器”窗口中拖放或使用第三方工具(如ideviceinstaller)(可在Homebrew中使用)进行此操作。

You should never set NO_LAUNCH . 永远不要设置NO_LAUNCH

http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_LAUNCH http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_LAUNCH

You also need to enable you device for develop and turn on UIAutomation in the Settings.app > Developer. 您还需要启用设备进行开发,并在Settings.app> Developer中打开UIAutomation。

  1. Enabling device for development 启用开发设备
  2. RunLoop::Fifo::NoReaderConfiguredError RunLoop :: Fifo :: NoReaderConfiguredError

UPDATE In response to this question, I rewrote the Testing on Physical Devices Calabash iOS wiki page. 更新针对此问题,我重新编写了“ 在物理设备上测试 Calabash iOS Wiki”页面。 Wow, that content was ancient! 哇,内容太古老了!

As long as the file is build with calabash then that is not a problem. 只要文件是用calabash构建的,那不是问题。 You just call cucumber with APP_BUNDLE_PATH to where ever your .ipa file is and should be all set. 您只需使用APP_BUNDLE_PATH调用Cucumber,即可将您的.ipa文件放置在任何位置,并且应该全部设置好。

But you should be aware that .ipa needs to be build to match the target you run the tests on. 但是您应该意识到,需要构建.ipa以匹配运行测试的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM