DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Continuous Integration in the Client Side Using Xcode Server

Continuous Integration in the Client Side Using Xcode Server

Check out a tutorial that explains how to set configurations of Xcode Server in Xcode to use in the client side.

Hasancan Akgunduz user avatar by
Hasancan Akgunduz
·
Sep. 27, 18 · Tutorial
Like (2)
Save
Tweet
Share
5.22K Views

Join the DZone community and get the full member experience.

Join For Free

This article will guide you in setting configurations of XCode Server in Xcode to use in the client side. Client-side configuration might be quite handy if your company has a restricted web access policy from servers. All team members need to do the same configuration. At the end of the tutorial, we will have a continuous integration system with the following features:

  • Code static analysis and warning monitoring

  • Unit test runs

  • Code coverage measurement

  • Integration start options with manual, on every commit or by schedule

  • Incrementing build number and pushing into Git repo

  • Uploading app to Diawi and emailing to the testers

Firstly, the client should be set as Xcode Server with the following steps:

Open XCode -> Preferences -> Server&Bots

Image title

Image title

After turning XCode Server on, add this server into the xcode accounts:

Open XCode -> Preferences -> Accounts

Image title

Image title

Now you can add as many bots as you want. Bots may differ with their target git branches or their build configuration like Debug, Enterprise, or AppStore.

Select XCode -> Product -> Create Bot

Image title

Image title

Image title

Image title

Image title

Image title

Image title

After creating the bot, clicking on the integrate button starts the process. At the end of the process, the report overview screen displays the results. Each build needs a different build number. Since we are running the integration on the client side, we need to have a script that increments the build number and pushes it into a remote git repo to synchronize build numbers between team members. The script can be added as Archive Post Action:

Open Edit Scheme -> Archive -> Post-actions and select new run script action and add following script:

if [ "the$XCS_INTEGRATION_NUMBER" == "the" ]; then
echo "Not an integration build…"
else
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}

# increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
fi

buildnum=$(expr $buildnum + 1)
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}"
echo "Bumped build number to $buildnum"

echo "Committing the build number..."
cd ${PROJECT_DIR};git add src/Info.plist
cd ${PROJECT_DIR};git commit -m "Bumped the build number for test version."
cd ${PROJECT_DIR};git push -u
echo "Build number committed."
fi

There are many continuous integration tools for iOS, but XCode Server is a native continuous integration service, so you do not depend on third-party frameworks. It is supported by Apple and running unit tests and managing certificates are very compatible with XCode development environments.

Continuous Integration/Deployment XCode Integration

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Introduction Garbage Collection Java
  • Detecting Network Anomalies Using Apache Spark
  • Create a CLI Chatbot With the ChatGPT API and Node.js
  • When Should We Move to Microservices?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: