Automatic iOS and Android building and signing with Jenkins


i have automated a app which i build.
Now the smaller problem is that each build of the ipa (with xcode) takes about 6 Minutes. (Because npm, bower, etc.)

The bigger problem is that i dont know how to combine the iOS Build with the Android Build.
If i add a build step the projekt is failed if ios or android failed to build.
Or is it needed that i build in one project multiple platforms?

And the biggest problem is that the build process is hanging on xcode.

Going to invoke xcodebuild:, scheme: App name, sdk: DEFAULT, project: DEFAULT, clean: YES, archive:YES, symRoot: DEFAULT, configurationBuildDir: /Users/username/jenkins/workspace/App name/build/, codeSignIdentity: iPhone Distribution: Firstname Lastname (ID)
[ios] $ /usr/bin/xcodebuild -scheme "App name" clean build archive "CONFIGURATION_BUILD_DIR=/Users/username/jenkins/workspace/App name/build/" "CODE_SIGN_IDENTITY=iPhone Distribution: Firstname Lastname (ID)" CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist
Build settings from command line:
    CODE_SIGN_IDENTITY = iPhone Distribution: Firstname Lastname (ID)
    CONFIGURATION_BUILD_DIR = /Users/username/jenkins/workspace/App name/build/

If i change manually in Xcode the “Team” to the correct team and changing developer to “iPhone Distribution: Firstname Lastname (ID)” it builds via jenkins. But if you remove the platform manually (Clean) then it doesnt work.

And maybe we can create a Jenkins Build Script together, which is fast and great!
Let’s start.

What plugins i’m using?

Project configuration: (Relevant things / Build steps)

  • Source-Code-Management: GIT
  • Repository:…
  • Credentials: Predefined
  • Additional Behaviours: None
  • Build-Steps:
  • Shell execute
    • rm -rf build
    • npm install
    • bower install
    • ionic state restore
    • ionic platform add ios
    • ionic resources
    • ionic platform update ios
    • gulp sass
    • gulp
  • Xcode
    • Target: Release
    • Clean before build?: YES
    • Generate Archive?: YES
    • Pack application and build .ipa?: YES
    • Manifest Plist URL:
    • Code Signing & OS X keychain options
      • Code Signing Identity: iPhone Distribution: Firstname Lastname (ID)
      • Embedded Profile: ${HOME}/Library/MobileDevice/Provisioning Profiles/GUID.mobileprovision
    • Unlock Keychain?: YES
      • Keychain: none (specify one below)
      • Keychain path: ${HOME}/Library/Keychains/login.keychain
      • Keychain password: Passwort from user of mac
    • Advanced Xcode build options
      • Xcode Schema File: App name
      • Custom xcodebuild arguments: “CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist”
      • Xcode Project Directory: platforms/ios
      • Build output directory: ${WORKSPACE}/build/

Thanks in Advance for ideas and tips how to build a project with Ionic and Jenkins. (Maybe we can use ionic build ios and connect it with codesign)

I am also having this problem. Did you ever solve it?

After pulling code from GIT, I run

ionic platform add ios (succeeds)
ionic build ios (succeeds)

And finally this:
xcodebuild -scheme BestAppEver clean archive -archivePath build/BestAppEver

However, this results in a terminal window spinning forever with no end. This command DOES work if I open the generated .xcodeproj file first and then run the command in the terminal window.

I’m hitting the exact same thing. Changing the “Team” in Xcode fixes it, but I want a fully automated build-box :frowning:

I’ve see where running ionic build ios --device bypasses some of the build trouble. I’ve deployed a build system using a ruby script that sets up xcode schemes automatically.