require 'calabash-cucumber/launcher' # APP_BUNDLE_PATH = "#{ENV['HOME']}/Library/Developer/Xcode/DerivedData/??/Build/Products/Calabash-iphonesimulator/??.app" # You may uncomment the above to overwrite the APP_BUNDLE_PATH # However the recommended approach is to let Calabash find the app itself # or set the environment variable APP_BUNDLE_PATH Before do |scenario| @calabash_launcher = Calabash::Cucumber::Launcher.new unless @calabash_launcher.calabash_no_launch? @calabash_launcher.relaunch @calabash_launcher.calabash_notify(self) end end After do |scenario| unless @calabash_launcher.calabash_no_stop? calabash_exit if @calabash_launcher.active? @calabash_launcher.stop end end end at_exit do launcher = Calabash::Cucumber::Launcher.new if launcher.simulator_target? launcher.simulator_launcher.stop unless launcher.calabash_no_stop? end end