Skip to main content

Generate Xcode .xcodeproj bundles from scratch — no macOS required

Project description

xcodeproj-creator

Generate Xcode .xcodeproj bundles from scratch — no macOS required.

Build valid Xcode projects on Linux (or any platform) for iOS/macOS apps, then hand them off to Xcode or CI services like Codemagic for building. Zero dependencies — stdlib only.

Installation

pip install xcodeproj-creator

CLI

# Minimal — creates MyApp.xcodeproj in current directory
xcodeproj-create MyApp --bundle-id com.example.myapp

# Full options
xcodeproj-create MyApp \
    --bundle-id com.example.myapp \
    --output MyApp.xcodeproj \
    --deployment-target 18.0 \
    --swift-version 5.0 \
    --team-id ABCDEF1234 \
    --sources MyApp/ \
    --resources MyApp/Resources/ \
    --asset-catalogs MyApp/Assets.xcassets

# Modern Xcode 16+ project (objectVersion 77, auto-syncs files from disk)
xcodeproj-create MyApp \
    --bundle-id com.example.myapp \
    --object-version 77

CLI Options

Option Description Default
name Project and target name (required)
--bundle-id Bundle identifier (required)
--output, -o Output path <name>.xcodeproj
--deployment-target iOS deployment target 18.0
--swift-version Swift language version 5.0
--team-id Development team ID (none)
--sources Directories to scan for **/*.swift (none)
--resources Directories to scan for resources (none)
--asset-catalogs Asset catalog paths (.xcassets) (none)
--product-type Xcode product type com.apple.product-type.application
--object-version pbxproj format: 56 (classic) or 77 (modern file-sync) 56

Python API

from xproject_creator import ProjectBuilder

# Classic project (objectVersion 56) — list files explicitly
project = ProjectBuilder("MyApp", bundle_id="com.example.myapp")
project.set_deployment_target("18.0")
project.set_swift_version("5.0")
project.set_development_team("ABCDEF1234")
project.add_swift_sources("MyApp/", glob="**/*.swift")
project.add_resources("MyApp/Resources/")
project.add_asset_catalog("MyApp/Assets.xcassets")
project.add_shell_script_phase("Lint", "swiftlint")
project.set_build_setting("ENABLE_BITCODE", "NO")
project.save("MyApp.xcodeproj")

# Modern project (objectVersion 77) — files auto-sync from disk
project = ProjectBuilder("MyApp", bundle_id="com.example.myapp", object_version="77")
project.set_development_team("ABCDEF1234")
project.save("MyApp.xcodeproj")

Builder Methods

Method Description
set_deployment_target(version) Set minimum iOS version
set_swift_version(version) Set Swift language version
set_development_team(team_id) Set code signing team
set_build_setting(key, value, config=) Set a build setting (optionally per-config)
add_swift_source(path) Add a single Swift file
add_swift_sources(dir, glob=) Add Swift files matching a glob
add_resource(path) Add a single resource file
add_resources(dir, glob=) Add resource files from a directory
add_asset_catalog(path) Add an .xcassets catalog
add_shell_script_phase(name, script) Add a shell script build phase
add_file_sync_group(path) Add a file-sync root group (v77 only)
save(output_path) Write the .xcodeproj bundle to disk

All methods return self for chaining (except save).

What Gets Generated

MyApp.xcodeproj/
  project.pbxproj                          # Full ASCII plist
  xcshareddata/
    xcschemes/
      MyApp.xcscheme                       # Build + Run scheme

The generated project includes:

  • Debug and Release build configurations with sensible defaults
  • Sources, Resources, and Frameworks build phases
  • Auto-generated Info.plist (via GENERATE_INFOPLIST_FILE = YES)
  • Proper group hierarchy mirroring the filesystem (v56) or file-system-synchronized groups (v77)

objectVersion 56 vs 77

v56 (classic) v77 (modern, Xcode 16+)
File tracking Each file listed individually in the project Auto-synced from disk via PBXFileSystemSynchronizedRootGroup
Adding files Use add_swift_source(), add_resources(), etc. Just save() — Xcode discovers files automatically
Compatibility All Xcode versions Xcode 16+ only

Supported Product Types

Type Identifier
iOS App (default) com.apple.product-type.application
Framework com.apple.product-type.framework
Static Library com.apple.product-type.library.static
Unit Test Bundle com.apple.product-type.bundle.unit-test
UI Test Bundle com.apple.product-type.bundle.ui-testing
App Extension com.apple.product-type.app-extension

Development

make install        # Create venv and install with dev deps
make check          # Format + lint + typecheck + test
make test           # pytest with coverage
make lint           # ruff check
make typecheck      # mypy strict
make format         # ruff format + autofix

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xcodeproj_creator-0.1.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcodeproj_creator-0.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file xcodeproj_creator-0.1.0.tar.gz.

File metadata

  • Download URL: xcodeproj_creator-0.1.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xcodeproj_creator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb3b149b2e5bff8ca836c84dfbd207a192239acc5562ab15ea4f52469bf945d7
MD5 f56d210bb1e93001e46a0628f7e1a955
BLAKE2b-256 0e77124e7a8c8754bf3e1e05505f093b551bce728aa37e495506da0f50dce3cf

See more details on using hashes here.

File details

Details for the file xcodeproj_creator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xcodeproj_creator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bdfa1f985698376cf4ad35e219480b8ba4e69bab1cf87ded6b34544f71916e4b
MD5 258863e2752709a94fe3cb39954f79a7
BLAKE2b-256 aa586b711e99948b1d953f02b98e4b5c7d551a8472ad4f5144cab2195d72a3ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page