Mobile Development 19 min read

Automated iOS Application Build and Push to App Store

This article presents a comprehensive method for automating the build and deployment of iOS applications to the Apple App Store, detailing the manual challenges, required certificates and provisioning profiles, and two practical solutions—using ExportOptions.plist and Fastlane—to achieve fully automated push and reduce manual effort.

DevOps
DevOps
DevOps
Automated iOS Application Build and Push to App Store

The document describes an automated approach for pushing iOS applications to the Apple App Store after centralized build, addressing the inefficiencies of manual upload and the need for certificate and provisioning profile management.

Background : iOS apps require company or enterprise certificates and provisioning profiles. Manual upload is time‑consuming, especially with frequent releases, and the R&D center seeks a fully automated pipeline.

Technical terminology includes the iOS build process (pre‑process, compile, assemble, link), development languages (Objective‑C, Swift, JavaScript), and the three key elements of iOS distribution: certificates, identifiers (App ID/Bundle ID), devices, and provisioning profiles.

Problem description : After centralized build, the upload step to the App Store remains manual, involving multiple tools (Xcode UI, Application Loader) and complex certificate handling, leading to high labor cost and low efficiency.

Solution – 4.1 Build‑push log analysis : By analyzing build logs (CompileC, Libtool, CreateUniversalBinary, Ld) the team identified the commands needed for automated upload. The altool command line utility is used for validation and upload:

project_path=/Users/abc/ipa
project_name=AutoDeployTest
scheme_name=ABCDeploy
development_mode=Release
build_path=${project_path}/build
exportOptionsPlistPath=${project_path}/ExportOptions.plist
exportIpaPath=${project_path}/ABCDir/${development_mode}
altoolPath="/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool"
"$altoolPath" --validate-app -f ${exportIpaPath}/${scheme_name}.ipa -u 123 -p 123 ios --output-format xml
"$altoolPath" --upload-app -f ${exportIpaPath}/${scheme_name}.ipa -u 123 -p 123 ios --output-format xml

This script validates the .ipa and uploads it, checking the XML response for success-message or product-errors .

Solution – 4.2 Fastlane automation : Fastlane, a Ruby‑based CI tool, provides actions such as deliver for App Store upload. A Deliverfile stores metadata (username, bundle identifier, screenshots, pricing, contact info, etc.) to eliminate manual entry. Example snippet:

# The Deliverfile allows you to store various iTunes Connect metadata
username "123"
app_identifier "com.abc.test"
copyright "版权信息"
screenshots_path "./fastlane/screenshots"
price_tier 0
trade_representative_contact_information(
  first_name: "yinhang",
  last_name: "nongye",
  address_line1: "123",
  city_name: "BeiJing",
  state: "BeiJing",
  country: "China",
  postal_code: "100000",
  phone_number: "+86 13700000000",
  email_address: "abc.abchina.com"
)
app_review_information(
  first_name: "yinhang",
  last_name: "nongye",
  phone_number: "+86 13700000000",
  email_address: "abc.abchina.com",
  demo_user: "123",
  demo_password: "123",
  notes: "备注信息"
)
submission_information(
  export_compliance_encryption_updated: false,
  export_compliance_uses_encryption: false,
  content_rights_contains_third_party_content: false,
  add_id_info_uses_idfa: false
)
name({ 'zh-Hans' => "nongyeyinhang" })
description({ 'zh-Hans' => "APP的描述信息,用于APP功能的描述和介绍不能少于10个字符" })
release_notes({ 'zh-Hans' => "第一个版本测试" })
keywords({ "zh-Hans" => "农业, 银行" })
automatic_release true

Fastlane also requires a rating configuration JSON for iTunes compliance.

{
  "CARTOON_FANTASY_VIOLENCE": 0,
  "REALISTIC_VIOLENCE": 0,
  "PROLONGED_GRAPHIC_SADISTIC_REALISTIC_VIOLENCE": 0,
  "PROFANITY_CRUDE_HUMOR": 0,
  "MATURE_SUGGESTIVE": 0,
  "HORROR": 0,
  "MEDICAL_TREATMENT_INFO": 0,
  "ALCOHOL_TOBACCO_DRUGS": 0,
  "GAMBLING": 2,
  "SEXUAL_CONTENT_NUDITY": 0,
  "GRAPHIC_SEXUAL_CONTENT_NUDITY": 0,
  "UNRESTRICTED_WEB_ACCESS": 0,
  "GAMBLING_CONTESTS": 0
}

A Fastlane lane automates the entire process:

default_platform(:ios)
platform :ios do
  desc "上传至 App Store"
  lane :release do
    scheme_name = "ABCDeploy"
    output_directory = "/Users/abc/ipa"
    scheme_version = "1.0.0"
    output_name = "#{scheme_name}_#{scheme_version}.ipa"
    gym(
      export_method: "app-store",
      export_xcargs: "-allowProvisioningUpdates",
      scheme: scheme_name,
      clean: true,
      output_directory: output_directory,
      output_name: output_name
    )
    deliver(
      ipa: output_name,
      submit_for_review: true,
      ignore_language_directory_validation: true,
      force: true,
      skip_screenshots: true
    )
  end
end

Conclusion : Both the ExportOptions.plist method and the Fastlane approach provide reliable, fully automated iOS app push solutions, reducing manual effort, improving CI/CD efficiency, and supporting the R&D center’s DevOps goals.

Mobile DevelopmentiOSDevOpscontinuous integrationAutomated Deploymentfastlane
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.