Git Product home page Git Product logo

gym's Introduction

deliversnapshotframeitPEMsighproducecertspaceshippilotboardinggymscan

-------

gym

Twitter: @KauseFx License Gem Build Status

Building your app has never been easier

Get in contact with the developer on Twitter: @KrauseFx


FeaturesInstallationUsageTipsNeed help?


gym is part of fastlane: connect all deployment tools into one streamlined workflow.

What's gym?

gym builds and packages iOS apps for you. It takes care of all the heavy lifting and makes it super easy to generate a signed ipa file 💪

gym is a replacement for shenzhen.

Before gym

xcodebuild clean archive -archivePath build/MyApp \
                         -scheme MyApp
xcodebuild -exportArchive \
           -exportFormat ipa \
           -archivePath "build/MyApp.xcarchive" \
           -exportPath "build/MyApp.ipa" \
           -exportProvisioningProfile "ProvisioningProfileName" 

With gym

gym

Why gym?

gym uses the latest APIs to build and sign your application which results in much faster build times.

          |  Gym Features

--------------------------|------------------------------------------------------------ :rocket: | gym builds 30% faster than other build tools like shenzhen 🏁 | Beautiful inline build output 📖 | Helps you resolve common build errors like code signing issues 🚠 | Sensible defaults: Automatically detect the project, its schemes and more 🔗 | Works perfectly with fastlane and other tools :package: | Automatically generates an ipa and a compressed dSYM file :bullettrain_side: | Don't remember any complicated build commands, just gym 🔧 | Easy and dynamic configuration using parameters and environment variables 💾 | Store common build settings in a Gymfile 📤 | All archives are stored and accessible in the Xcode Organizer 💻 | Supports both iOS and Mac applications

/assets/gymScreenshot.png


/assets/gym.gif

Installation

sudo gem install gym

Make sure, you have the latest version of the Xcode command line tools installed:

xcode-select --install

Usage

gym

That's all you need to build your application. If you want more control, here are some available parameters:

gym --workspace "Example.xcworkspace" --scheme "AppName" --clean

If you need to use a different xcode install, use xcode-select or define DEVELOPER_DIR:

DEVELOPER_DIR="/Applications/Xcode6.2.app" gym

For a list of all available parameters use

gym --help

If you run into any issues, use the verbose mode to get more information

gym --verbose

To pass boolean parameters make sure to use gym like this:

gym --include_bitcode true --include_symbols true

To access the raw xcodebuild output open ~/Library/Logs/gym

Gymfile

Since you might want to manually trigger a new build but don't want to specify all the parameters every time, you can store your defaults in a so called Gymfile.

Run gym init to create a new configuration file. Example:

scheme "Example"

sdk "iphoneos9.0"

clean true

output_directory "./build"    # store the ipa in this folder
output_name "MyApp"           # the name of the ipa file

Automating the whole process

gym works great together with fastlane, which connects all deployment tools into one streamlined workflow.

Using fastlane you can define a configuration like

lane :beta do
  xctool
  gym(scheme: "MyApp")
  crashlytics
end

You can then easily switch between the beta provider (e.g. testflight, hockey, s3 and more).

For more information visit the fastlane GitHub page.

How does it work?

gym uses the latest APIs to build and sign your application. The 2 main components are

When you run gym without the --silent mode it will print out every command it executes.

To build the archive gym uses the following command:

set -o pipefail && \
xcodebuild -scheme 'Example' \
-project './Example.xcodeproj' \
-configuration 'Release' \
-destination 'generic/platform=iOS' \
-archivePath '/Users/felixkrause/Library/Developer/Xcode/Archives/2015-08-11/ExampleProductName 2015-08-11 18.15.30.xcarchive' \
archive | xcpretty

After building the archive it is being checked by gym. If it's valid, it gets packaged up and signed into an ipa file.

gym automatically chooses a different packaging method depending on the version of Xcode you're using.

Xcode 7 and above

/usr/bin/xcrun xcodebuild -exportArchive \
-exportOptionsPlist '/tmp/gym_config_1442852529.plist' \
-archivePath '/Users/fkrause/Library/Developer/Xcode/Archives/2015-09-21/App 2015-09-21 09.21.56.xcarchive' \
-exportPath '/tmp/1442852529'

gym makes use of the new Xcode 7 API which allows us to specify the export options using a plist file. You can find more information about the available options by running xcodebuild --help.

Using this method there are no workarounds for WatchKit or Swift required, as it uses the same technique Xcode uses when exporting your binary.

Xcode 6 and below

/usr/bin/xcrun /path/to/PackageApplication4Gym -v \
'/Users/felixkrause/Library/Developer/Xcode/Archives/2015-08-11/ExampleProductName 2015-08-11 18.15.30.xcarchive/Products/Applications/name.app' -o \
'/Users/felixkrause/Library/Developer/Xcode/Archives/2015-08-11/ExampleProductName.ipa' \ 
--sign "identity" --embed "provProfile"

Note: the official PackageApplication script is replaced by a custom PackageApplication4Gym script. This script is obtained by applying a set of patches on the fly to fix some known issues in the official Xcode PackageApplication script.

Afterwards the ipa file is moved to the output folder. The dSYM file is compressed and moved to the output folder as well.

Tips

fastlane Toolchain

  • fastlane: Connect all deployment tools into one streamlined workflow
  • deliver: Upload screenshots, metadata and your app to the App Store
  • snapshot: Automate taking localized screenshots of your iOS app on every device
  • frameit: Quickly put your screenshots into the right device frames
  • PEM: Automatically generate and renew your push notification profiles
  • produce: Create new iOS apps on iTunes Connect and Dev Portal using the command line
  • cert: Automatically create and maintain iOS code signing certificates
  • spaceship: Ruby library to access the Apple Dev Center and iTunes Connect
  • pilot: The best way to manage your TestFlight testers and builds from your terminal
  • boarding: The easiest way to invite your TestFlight beta testers
  • scan: The easiest way to run tests of your iOS and Mac app

Use the 'Provisioning Quicklook plugin'

Download and install the Provisioning Plugin.

Need help?

Please submit an issue on GitHub and provide information about your setup

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.

gym's People

Contributors

cbowns avatar cbrockschmidt avatar dbireta-mediafly avatar ide avatar jessecrocker avatar krausefx avatar lacostej avatar masa-beheim avatar maxgoedjen avatar mrgrauel avatar xfreebird avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.