---
title: "#125: Building and Packaging Apps with Gym 💪📦"
url: https://littlebitesofcocoa.com/125-building-and-packaging-apps-with-gym
author: Jake Marsh
published: 2015-11-13
topics: ["Tools","Fastlane"]
description: "Today we're continuing our look at the Fastlane suite of tools with gym. It can help us build and package our app into an.ipa file ready for submission to..."
---

# #125: Building and Packaging Apps with Gym 💪📦

By Jake Marsh, November 13, 2015. HTML: https://littlebitesofcocoa.com/125-building-and-packaging-apps-with-gym

Today we're continuing our look at the [Fastlane](https://littlebitesofcocoa.com/topics/56-fastlane?v=l) suite of tools with _gym_. It can help us build and package our app into an .ipa file ready for submission to Apple, or some other kind of distribution. Let's get started.

We'll start by installing _gym_:

``` shell
gem install gym
```

Now we can build and export an **ipa** like this:

``` shell
gym
```

Alright, have a great weekend everyone! Just kidding, while _gym_ is great about asking for answers to things we don't specify such as what **Xcode Scheme** to use when building. It also allows us to specify just about any option we can imagine when running it on the command line. For example, let's build our app using its **Workspace** and the <i>app-store</i> **scheme**:

``` shell
gym --workspace "Spaceships.xcworkspace" --scheme "app-store" --clean
```

Simple enough, we're telling gym to build using our desired Workspace and Scheme, and that we'd like to do a clean build.

_gym_ has options for just about everything: **bitcode**, **codesigning**, **provisioning**, **team id**, and much more. It's extremely flexible but including all those command line options each time can be drag. Let's unlock more of the power of _gym_ by creating what's called a `Gymfile` in our project's directory. This is just a plain text file, and looks like this:

``` ruby
scheme "Spaceships"
sdk "iphoneos9.0"
clean true

output_directory "./build" # where to put the ipa
output_name "Spaceships"   # what to call the ipa
```

Now we can run _gym_ again from the command line and we don't need to specify all those options each time, nice! More info about _gym_ can be found at [git.io/gym](http://git.io/gym)
