Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Tutorial: Calabash config
This tutorial demonstrates how to 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 of your app is launched.
This approach has 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.
This configuration was initially suggested by Jian Fang and David Siegel in his Do you love Calabash iOS but hate that cal target? blog post. Thanks!
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 App Store. 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.
|master||demo/calabash-config||screencast.com ~5 minutes|
Step 1. Create Calabash configuration
Step 2. Download calabash.framework
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 ---------------------------
3. Link calabash.framework
If your Debug configuration already links CFNetwork.framework, you can skip the "-framework" and "CFNetwork" linker flags.
These are the linker flags:
-ObjC -force_load "$(SOURCE_ROOT)/calabash.framework/calabash" -framework CFNetwork
If your app already links the CFNetwork.framework, don't add "-framework CFNetwork".
4. Create Calabash Scheme
5. Build and Run
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