Relax
Relax is a tiny release tool for iOS developers who don't want to be bothering with code signing and Xcode stuffs!!
You just configure scheme and provisioning_profile to build archive and IPA files.
Relax will save your time. It's hard to understand xcodebuild stuff, for example, code signing mechanism. Relax takes care of much of the hassle of them. so you can focus on development.
Features
Mutli distribution
- Eanble to configure multi distribution for each code signing identity, info plist and build settings(i.e. ad-hoc builds for different clients).
Less configuration
- One configuration file instead of many xcconfig files or build configurations in your project
- Detect and check the related identity from a provisioning profile.
- Automatically generate ExportOptions.plist for each distribution
Easy & Simple
- Easy to install into macOS
- Provide simple CLI to resolve issues of IPA distribution support and CI environment.
- Validate and Resign IPA
- Inspector of keychain and provisioning profiles
Installation
Homebrew
$ brew install scenee/formulae/relaxInstall script
$ curl -fsSL https://raw.githubusercontent.com/SCENEE/relax/master/install.sh | bashNOTE: You don't need to take care of a host environment(i.e. ruby version and gem settings).
Requirements
- Xcode9.4.1+
Create a IPA file
$ relax dist /path/to/xcodeproj_or_xcworkspace --scheme scheme_name --profile profile_name
$ # OR
$ relax dist /path/to/xcodeproj_or_xcworkspace -s scheme_name -p profile_nameOr use Relfile.
$ relax init
$ relax dist adhocNotes
- You need to create a provisioning profile for your identity(certificate) and install them to a build machine by yourself because Relax doesn't access to Apple Developer Center for security reasons.
relax profile addandrelax keychain addhelp you to install them and resolve permissions for your identities in your keychain. I highly recommend to use those commands. See here and here.
Relfile
Relfile is a configuration file for Relax. The declarative file will really make you easy to understand how to customize Info.plist and build settings for a distribution. See here for detail.
Here is an example.
version: '2'
workspace: SampleApp
distributions:
adhoc:
# Required
scheme: SampleApp
provisioning_profile: 'Relax Adhoc'
# Optional
version: '1.0.1'
configuration: Debug
bundle_identifier: com.scenee.SampleApp.dev
bundle_version: '$BUILD_NUMBER' # You can use shell environment variables!
info_plist:
CFBundleName: 'SmapleApp(Debug)'
UISupportedExternalAccessoryProtocols:
- com.example.test-accessory
build_settings:
OTHER_SWIFT_FLAGS:
- '-DMOCK'
export_options:
compileBitcode: false
ent:
# Required
scheme: SampleApp
provisioning_profile: 'Relax Enterprise'
# Optional
bundle_identifier: com.scenee.SampleApp
bundle_version: '%b-%h-$c' # See 'Bundle Version Format section'
info_plist:
UISupportedExternalAccessoryProtocols:
- com.example.accessory
framework:
# Required
scheme: Sample Framework
# Optional
configuration: Release
log_formatter: xcpretty # OptionalUse Environment variables in Relfile
You can use Environment variables in Relfile. That's much useful in CI services. For example,
development2:
scheme: Sample App
bundle_version: $BUILD_NUMBER
....$ BUILD_NUMBER=11 relax archive development2or
$ export BUILD_NUMBER=11
$ relax archive development2But, you know, you can't use Xcode build setting variables (like PRODUCT_NAME etc.) in Relfile because they can be overridden by Relfile's definitions.
Export Option Support
| Option | Response status |
|---|---|
| compileBitcode | OK |
| embedOnDemandResourcesAssetPacksInBundle | Not supported |
| iCloudContainerEnvironment | Not supported |
| manifest | Not supported |
| method | Auto-assigned 'ad-hoc', 'app-store', 'development' or 'enterprise' from provisioning_profile. |
| onDemandResourcesAssetPacksBaseURL | Not supported |
| teamID | Auto-assigned from provisioning_profile. |
| provisioningProfiles | Auto-assigned from provisioning_profile. |
| signingCertificate | Auto-assigned 'iPhone Developer' or 'iPhone Distribution' from provisioning_profile. |
| signingStyle | Auto-assigned 'automatic' or 'manual' determined from provisioning_profile. |
| thinning | OK |
| uploadBitcode | OK |
| uploadSymbols | OK |
Bundle Version Format
You can use specific format characters in a value of bundle_version field.
The characters and their meanings are as follows.
| Character | Meaning |
|---|---|
| %c | Build configuration |
| %h | Git abbreviated commit hash |
| %b | Git branch name |
Advanced usages
Create an archive file
$ relax archive devCreate a IPA file
$ relax export "/path/to/xcarchive"
$ # OR
$ relax export devValidate a IPA file
Check a IPA file if it has a correct code signing and entitlements.
$ relax validate "$(relax show adhoc ipa)"You can also validate an archive file.
Resign a IPA file for an enterprise distribution
Resign a IPA file for a distribution by a provisioning profile. The related identity is selected automatically from active keychains.
$ relax resign -i "com.mycompany.SampleApp" -p "<enterprise-provisioning-profile>" /path/to/ipakeychain commands
The keychain module commands make you free from keychain stuff and prevent a build break!
Actually this is an useful wrapper of security command.
Run here and see this script for detail.
$ relax help keychain
profile commands
The profile module commands make it easy to find, use or remove provisioning profiles without Xcode Preferences.
Run here and see this script for detail.
$ relax help profile
Symbolicate a crash log
$ relax symbolicate sampleapp.crash SampleApp.xcarchiveKnown Issues
- Homebrew(0.9.x) failed to update Relax. Please use Homebrew(1.1.2+) with
brewe update. - Relax hasn't yet support Carthage. If you use it, Relax might not be working well. I'm glad for you to make a pull request to support it!
stty: stdin isn't a terminalcan be printed on a CI build server, but Relax is working well.