-
Notifications
You must be signed in to change notification settings - Fork 369
Tutorial: Calabash config
This tutorial demonstrates how add the calabash.framework to your existing production app by creating a new Calabash Xcode Build Configuration. Linking the calabash.framework will start the Calabash iOS server when the Calabash version your app is launched.
This is approach as the advantage that it is easy to setup and maintain. It also has the advantage of allowing you to set up Preprocessor Compiler Macros for the Calabash builds only. Preprocessor macros allow you to add #ifdef
statements to conditionally include or exclude blocks of code.
Using a Calabash Build Configuration is a happy medium between a separate -cal target and simply linking Calabash in the Debug Build Configuration.
Why load calabash.framework only in the Calabash config?
The Calabash server contains symbols and methods that will cause any application that links to it to be rejected from the AppStore. By default, applications are archived for the App Store (and for distribution to beta testers) using a Release configuration. By only linking the calabash.framework in the Debug configuration will ensure that you never accidently submit an application that has the Calabash server linked.
Starting Point | Completed | Video |
---|---|---|
master | demo/calabash-config | pending |
===
![02-calabash-link]
Create a Gemfile in the same directory as your .xcodeproj:
source "https://rubygems.org"
gem "calabash-cucumber", ">= 0.16", "< 2.0"
Then execute the following commands in that directory:
$ bundle
$ bundle exec calabash-ios download
----------Info----------
caution: excluded filename not matched: __MACOSX/*
caution: excluded filename not matched: calabash.framework/.DS_Store
---------------------------
If your Debug configuration already links CFNetwork.framework, you can skip the "-framework" and "CFNetwork" linker flags.
===
===
===
===
Be sure that you have selected the Calabash configuration. You can target a simulator or physical device.
In your Xcode console you should see the following output - the exact content will differ by Calabash version:
DEBUG CalabashServer:222 | Creating the server: <LPHTTPServer: 0x7f80b3d066e0>
DEBUG CalabashServer:223 | Calabash iOS server version: CALABASH VERSION: 0.16.4
DEBUG CalabashServer:226 | App Base SDK: iphonesimulator9.0