- Xcode >= 8.3
- ruby >= 2.3.1
- bundler gem
- xcpretty gem
Preferred directory layout:
$ tree -L 2 -d
.
├── calabash
│ ├── DeviceAgent.iOS
│ ├── iOSDeviceManager
│ ├── run_loop
- pull git@github.com:calabash/calabash-codesign.git to ~/.calabash/calabash-codesign
- pull git@github.com:calabash/iOSDeviceManager.git and checkout develop
- pull git@github.com:calabash/DeviceAgent.iOS.git and checkout develop
- pull git@github.com:calabash/run_loop.git and checkout develop
- Configure bundler to use local run_loop:
$ bundle config local.run_loop /path/to/run_loop
This is required to build the Xcode project which have hard-wired code signing requirements.
$ ~/.calabash/calabash-codesign/apple/create-keychain.sh
Output like this is normal:
security: SecPolicySetValue: One or more parameters passed to a function were not valid.
$ cd DeviceAgent.iOS
$ make test-app
$ make test-ipa
$ make ipa-agent
$ make app-agent
$ make build
$ cd Products
$ ./iOSDeviceManager install <UDID> \
../../DeviceAgent.iOS/Products/ipa/TestApp/TestApp.app
# Task responds to DEVICE_AGENT and IOS_DEVICE_MANAGER for non-standard paths.
# See Preferred layout in requirements section.
$ cd run_loop
$ rake device_agent:install
# Show what files were touched
$ git status
# Revert DeviceAgent binaries
$ rake device_agent:checkout
This is a smoke test to see if everything is configured correctly.
# Requires you have made the TestApp for simulator (above)
$ cd DeviceAgent.iOS/cucumber
$ bundle update
$ be cucumber -t @args
To target a physical device:
***** Install TestApp FIRST!!! (as above) *****
$ DEVICE_TARGET=< udid > be cucumber -t @args -t ~@simulator
$ DEVICE_TARGET=< device name > be cucumber -t @args -t ~@simulator
All the cucumber tests are expected to pass.
Please note that some tests are not available for physical devices (-t ~@simulator
).
To see more information, use DEBUG=1 be cucumber
.
If you make a change in run_loop, it will be reflected in the next cucumber
run.
Edit cucumber/features/support/01_launch.rb
:
# Switch from `iOSDeviceManager` launcher to `xcodebuild` launcher.
# Maintainers only
# :cbx_launcher => :xcodebuild,
When running with xcodebuild
you will need to manually update the
DeviceAgent.iOS Xcode code signing settings for the AppStub target
if your device is not in calabash-codesign
provisioning profiles.
# Available after run-loop is installed.
$ run-loop simctl tail
# Available after first iOSDeviceManager command is run.
$ tail -F ~/.calabash/iOSDeviceManager/logs/current.log
# Available after first `xcodebuild` cucumber run.
$ tail -F ~/.run-loop/xcuitest/xcodebuild.log