New to pantograph? Click here to open the installation & setup instructions first
1) Install the latest Xcode command line tools
xcode-select --install
# Install ruby via homebrew (macOS & linux only) brew install ruby # Set ruby in your shell path (example uses Zsh) echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc # Using RubyGems gem install pantograph
3) Navigate to your project and run
pantograph init
pantograph
Configuring pantograph
Skip update check when launching pantograph
You can set the environment variable PANTOGRAPH_SKIP_UPDATE_CHECK
to skip the update check.
Hide changelog information at the end of running pantograph
You can set the environment variable PANTOGRAPH_HIDE_CHANGELOG
to hide the detailed changelog information when new pantograph versions are available.
Output environment variables
- To hide timestamps in each row, set the
PANTOGRAPH_HIDE_TIMESTAMP
environment variable to true (overruled by--verbose
). - To disable output formatting, set the
PANTOGRAPH_DISABLE_OUTPUT_FORMAT
environment variable to true.
How pantograph works
Priorities of parameters and options
The order in which pantograph tools take their values from
- CLI parameter (e.g.
gym --scheme Example
) or Pantfile (e.g.gym(scheme: 'Example')
) - Environment variable (e.g.
GYM_SCHEME
) - Tool specific config file (e.g.
Gymfile
containingscheme 'Example'
) - Default value (which might be taken from the
Appfile
, e.g.app_identifier
from theAppfile
) - If this value is required, you'll be asked for it (e.g. you have multiple schemes, you'll be asked for it)
Directory behavior
pantograph was designed in a way that you can run pantograph from both the root directory of the project, and from the ./pantograph
sub-folder.
Take this example Pantfile
on the path pantograph/Pantfile
sh "pwd" # => "[root]/pantograph" puts Dir.pwd # => "[root]/pantograph" lane :something do sh "pwd" # => "[root]/pantograph" puts Dir.pwd # => "[root]/pantograph" my_action end
The implementation of my_action
looks like this:
def run(params) puts Dir.pwd # => "[root]" end
Notice how every action and every plugin's code runs in the root of the project, while all user code from the Pantfile
runs inside the ./pantograph
directory. This is important to consider when migrating existing code from your Pantfile
into your own action or plugin. To change the directory manually you can use standard Ruby blocks:
Dir.chdir("..") do # code here runs in the parent directory end
This behavior isn't great, and has been like this since the very early days of pantograph. As much as we'd like to change it, there is no good way to do so, without breaking thousands of production setups, so we decided to keep it as is for now.
Passing parameters to pantograph command line tools
pantograph contains several command line tools, e.g. pantograph deliver
or pantograph snapshot
. To pass parameters to these tools, append the option names and values as you would for a normal shell command:
pantograph [tool] --[option]=[value] pantograph deliver --skip_screenshots=true pantograph snapshot --screenshots_path=xxxxx --schema=xxxx