Adding an automatic build to a Frank test setup
Frank is an automated test framework for iOS applications. It integrates with cucumber to allow acceptance testing of iOS apps. Mostly it is used with the simulator as reliable launching of apps on a device has not yet been achieved outside XCode.
The following adds an automated build prior to running the cucumber tests.
%x{xcodebuild -workspace #{APPNAME.gsub(/Frank$/,'')}.xcodeproj/project.xcworkspace -scheme #{APPNAME} -configuration Debug -sdk iphonesimulator build}
The xcodebuild command is part of Apple's developer tools, and provides command line builds. The %x{} syntax in Ruby executes a system (shell) command.
The -workspace flag indicates what workspace is used for the build. This flag is needed to place output in the same location as XCode 4.x uses for its builds. The #{APPNAME.gsub(/Frank$/,'')} computes the name of the project from the target name which is set in APPNAME in default Frank setups, within the env.rb file. Thus if the project is Foo and the target is FooFrank this computes Foo for the project name. The workspace being used is the default project specific workspace within the project file itself. This should match most single project cases. If you have multiple projects in one workspace you may need to change this to match your created workspace file.
The -scheme flag tells xcodebuild which scheme to use for the build which also selects the target being built.
The -configuration Debug selects the Debug build configuration, and -sdk iphonesimulator uses the latest sdk version in the simulator.
The final build on the command indicates that the build action for xcodebuild to perform is 'build'.