Setup Jenkins for iOS project

iOS jenkins CI Code Sign error: No matching provisioning profile found

1.Ensure the project is building successfully from Xcode to real target.

-In KeyChain
2. Copy all the development cretificates & credentials form your user folder to the system folder

3.Copy all the Provisioning profiles existing from
~/Library/MobileDevice/Provisioning Profiles
into
Jenkins/Library/MobileDevice/Provisioning Profiles

sudo chown -R admin:staff xxx

Inject environment variables to the build process:

DEVELOPER_DIR=/Applications/Xcode7.3.app/Contents/Developer

Inject passwords to the build as environment variables:
....

Build iOS binary by xcodebuilder:

Build & Archive

#BUILD & ARCHIVE
/usr/bin/xcodebuild -scheme XXX \
                    -workspace "${WORKSPACE}/XXX.xcworkspace" \
                    -configuration $CONFIGURATION \
                    -derivedDataPath "${WORKSPACE}/DerivedData" \
                    archive -archivePath ${WORKSPACE}/$ARCHIVEPATH \
                    CODE_SIGN_IDENTITY="${CODESIGN}" \
                    PROVISIONING_PROFILE_SPECIFIER=$PROVISIONING | /usr/local/bin/xcpretty -sc

Export

/usr/bin/xcodebuild -exportArchive \
                    -archivePath ${PWD}/${ARCHIVEPATH} \
                    -exportOptionsPlist ${exportOptionsPlist} \
                    -exportPath ${PWD}/${EXPORTPATH}

ExportOptions.plist It can be generated by Xcode export.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>enterprise</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.xxx.xxx</key>
        <string>ProvisionName</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>XXX</string>
    <key>thinning</key>
    <string>&lt;thin-for-all-variants&gt;</string>
</dict>
</plist>

Building issues:

Build with parameters from GitHub:

PR Build

Jenkins
Jenkins configuration
Jenkins Job
Github
Check Webhooks status

GitHub OAuth App

https://wiki.jenkins.io/display/JENKINS/GitHub+OAuth+Plugin

GitHub Jenkins

GitHub Generic Webhook Trigger

Screenshot

Jenkins in a Docker Container

results matching ""

    No results matching ""