0

I am having difficulty when trying to launch .ipa file on a physical device.

In the console I have been able to launch app and to hit different buttons etc. so I think I have everything set up correctly. I have also put the .ipa file in the directory where I'm running cucumber from.

[**********@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

The ipa file I'm using is stand alone and not built through xcode. The calabash framework version on the app and my calabash-ios version are the same 0.19.0 ,

Below is the 01_launch.rb, which I presume is standard

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

Needless to say I'm new to calabash, any help would be greatly appreciated

2 Answers2

0

In order to test an .ipa on a physical device, you need to install the ipa on the device first.

We have some sample code in the CalSmokeApp that shows how to use ideviceinstaller to install an .ipa on a physical device.

You should also see the Testing on Physical Devices wiki page.

$ DEVICE_TARGET=<udid> \
    DEVICE_ENDPOINT=http://<ip>:37265 \
    BUNDLE_ID=com.example.MyApp \
    cucumber
jmoody
  • 2,480
  • 1
  • 16
  • 22
  • Thanks for the response , the .ipa file is installed on the device, and I have been able to query the different pages and tap different elements on the app., the problem is when trying to run cucumber files. – paul o'mahony Apr 25 '16 at 16:18
  • In above staement I mean features file with cucumber cmd.I think I may have have spotted the problem and I was wondering if you could confirm if I'm going in the right direction. When ipa was built is didn't have the correct signature , which was changed to ios developer and then I could launch the app in console and query. the amended signature was deployed directly to the phone. The ipa file that is in the directory on my machine doesn't contain the right signature because a work around has to be created to build in new .ipa file with correct signature. – paul o'mahony Apr 25 '16 at 16:24
  • Apologies if I haven't been clear enough in describing the problem. Our development team has informed me that our build environment always assaigns a particular signature and a workaround has to be created, many thanks – paul o'mahony Apr 25 '16 at 16:32
0

its all about the xcode, ensure that you already build on simulator via xcode, if simulator already displayed, and then run the cucumber

Prasetyo Budi
  • 96
  • 1
  • 8