The ios-maven-plugin plugs in to the Maven build lifecycle to automate compilation and deployment of iOS applications. This enables continuous integration for the iOS platform with ease.
- Compilation of iOS applications
- Distribution of iOS applications
- Versioning of iOS applications
- One-step HockeyApp deployment
- Packaging of iOS applications (.ipa & .dSYM) for deployment to Nexus/Artifactory
- Available in the central repository
- The plugin relies on several tools that are only available on Mac OS X: xcodebuild, xcrun and agvtool.
- To let ios-maven-plugin take care of versioning, be sure to set 'Versioning System' in the project settings to
apple-generic
Compiles the application and generates an IPA package
Parameters
- ios.sourceDir
- ios.appName
- ios.scheme
- ios.sdk
- ios.codeSignIdentity
- ios.configuration
- ios.version
- ios.buildId
Deploys the IPA package as well as the generated dSYM.zip to HockeyApp
Parameters
- ios.sourceDir
- ios.appName
- ios.scheme
- ios.sdk
- ios.codeSignIdentity
- ios.configuration
- ios.version
- ios.buildId
- ios.hockeyAppToken
- ios.releaseNotes
Configure a basic POM for your iOS project or module and add:
<plugin>
<groupId>com.brewinapps</groupId>
<artifactId>ios-maven-plugin</artifactId>
<version>1.2</version>
<extensions>true</extensions>
<configuration>
<codeSignIdentity>iPhone Distribution: ACME Inc</codeSignIdentity>
<appName>AcmeApp</appName>
</configuration>
</plugin>
Compile to verify
mvn clean compile
Allow jenkins to access your keychain
To sign the package, unlock the keychain on the jenkins node. The two commands below can be set up as a pre-build shell script.
security list-keychains -s ~/Library/Keychains/jenkins.keychain
security unlock-keychain -p CHANGEME ~/Library/Keychains/jenkins.keychain
Deploy to HockeyApp
To deploy to HockeyApp add -Dios.hockeyAppToken=YOUR_TOKEN
as an argument and invoke mvn ios:deploy
.
- ios-maven-plugin sets the CFBundleShortVersionString to the Maven project version by default. You can override this behaviour by adding the
-Dios.version
argument. - To set CFBundleVersion to the svn revision or git commit add
-Dios.buildId=$SVN_REVISION
or-Dios.buildId=$GIT_COMMIT
respectively.