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 Apple, or some other kind of distribution. Let's get started.
We'll start by installing gym:
gem install gym
Now we can build and export an ipa like this:
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 app-store scheme:
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:
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