-
Notifications
You must be signed in to change notification settings - Fork 370
Updating your Calabash iOS version
Calabash iOS has a client-server architecture. The Calabash iOS gem is the client side which communicates via HTTP with the server that is embedded in your app via the Objective-C calabash.framework.
The Calabash iOS gem and the calabash.framework versions must be compatible.
In general, when you update the Calabash iOS gem, you should update the calabash.framework as well.
Most problems can be traced back to incompatible gem and framework versions.
You can read more about Calabash iOS's architecture here: An Overview of Calabash iOS Architecture.
$ calabash-ios version
0.12.3
Launch your app in the simulator and ask the server for the version.
$ curl http://localhost:37265/version
This is also the best way to determine if your app has properly linked the calabash.framework. If curl outputs "Failed to connect", you will know that your app has not properly linked the calabash.framework.
You can query the executable for the version of the calabash.framework that it has linked.
$ xcrun strings path/to/MyApp-cal.app/MyApp-cal | grep -E 'CALABASH VERSION'
0.12.3
The following methods will tell you what version you have downloaded. It will not tell you what version of the framework is linked in your application. Use the steps above (curl
or xcrun strings
) to see what version is embedded in your app.
$ calabash.framework/Resources/version
0.12.3
Note: tree
is not installed by default on MacOS. It can be installed with homebrew or MacPorts.
$ tree calabash.framework
calabash.framework
├── Headers -> Versions/Current/Headers
├── Resources -> Versions/Current/Resources
├── Versions
│ ├── 0.12.3 -> A
Start your app manually in the simulator or from Xcode and then launch a console.
$ calabash-ios console
> server_version['version']
0.12.3
> Calabash::Cucumber::MIN_SERVER_VERSION
0.12.3
The server_version['version']
must be greater than or equal ( >= ) to the MIN_SERVER_VERSION
.
Calabash will perform a runtime check to see if the server version is compatible with the gem version. Keep an eye out for warnings like this:
WARN: server version is not compatible with gem version
please update your server and gem
gem version: '0.12.3'
min server version: '0.12.3'
server version: '0.12.2'
If the server version is not compatible with the gem version, follow the directions below to update your application.
$ gem install calabash-cucumber
$ calabash-ios version
0.12.3
We recommend using bundler + Gemfile.
WARNING: If you are using sudo
to install gems, you should not use bundler. Please see Still installing gems with sudo? for recommended alternatives.
# Example Gemfile.
source 'https://rubygems.org'
gem 'calabash-cucumber', '0.12.3'
To install with bundler:
$ bundle update
$ bundle exec calabash-ios version
0.12.3
In the directory that contains the existing calabash.framework
run the following:
# Check your version.
$ calabash-ios version
0.12.3
# Download the framework.
$ calabash-ios download
----------Info----------
Shall I delete it and download the latest matching version?
Please answer yes (y) or no (n)
y
# Check the framework version is correct.
$ calabash.framework/Resources/version
0.12.3
- Xcode Project > Clean Build Folder... + Alt key or
- Shift + Option + Command + K
- Reset the simulator with
$ calabash-ios sim reset
. - Remove the calabash targets manually through the simulator UI.
This must be done manually or with third-party tools.
Use the methods describe above to verify the new version of the calabash server is embedded in your app.