Skip to content

Command line support

Pre-release
Pre-release

Choose a tag to compare

@seanhenry seanhenry released this 13 Apr 18:03
· 14 commits to master since this release
  • Now bundled with a command line tool to generate mocks from Terminal.
  • The app and Xcode extension are now fully sandboxed.
  • The project dependencies are now compiled and included so it can be built be anyone.
  • Improves formatting of the generated code.

Using the command line tool

For convenience, create a symbolic link to the CLI.

$ ln -s "/Applications/Swift Mock Generator for Xcode.app/Contents/MacOS/genmock" /usr/local/bin/genmock

Use $ genmock --help for a list of options.

See how this project generates its mocks here.

Sandboxing

This extension is fully sandboxed which means you need to give permission to read your project files before using it.

Give permission when automatically detecting the project path

  • Open the companion app.
  • Press "Give permission to read directory".
  • Select the directory and press "Grant permission".
  • In Xcode, generate your test double.

Give permission when manually choosing the project path

  • Open the companion app.
  • Press the select directory button.
  • Select the directory and press "Open".
  • In Xcode, generate your test double.

Please note if using manual project paths before v0.25 you will have to select your project path again.