홈으로 돌아가기

Windows에서 Mac 없이 iOS 개발 — GitHub Actions

이 기사는 GitHub Actions, XcodeGen, Claude Code를 사용해 Windows에서 Mac 없이 iOS 앱을 개발하고 배포하는 방법을 설명합니다. App Store의 두 예제: 메신저와 계산기. 인증서와 파이프라인에 대한 전체 지침.

Mac 없이 iOS: Windows에서 App Store까지 15분
Advertisement 728x90

Windows에서 GitHub Actions와 XcodeGen으로 iOS 앱 개발하기

암호화 메신저 Dark Message와 HVAC 엔지니어링 계산기 두 iOS 앱이 App Store에 출시되었습니다. 이들은 MacBook 없이 Windows에서 완전히 개발되었습니다. 과정은 다음과 같습니다: 코드는 로컬에서 작성되고, 빌드와 서명은 GitHub Actions의 가상 macOS 머신에서 이루어집니다. 저장소에 푸시한 후 iPhone에서 빌드까지 걸리는 시간은 15분입니다.

이 방법은 macOS에 대한 Xcode 요구 사항을 우회합니다. GitHub는 Xcode가 설치된 macOS 무료 러너를 제공합니다. 설정에는 Apple Developer 계정, YAML에서 프로젝트를 생성하는 XcodeGen, CI/CD 파이프라인, 서명 인증서가 포함됩니다.

다양한 숙련도에 따른 개발 경로

접근 방식 선택은 기술 수준에 따라 다릅니다:

Google AdInline article slot
  • AI를 활용한 라이브 코딩: Claude Code가 설명에서 SwiftUI 코드를 생성합니다. Windows의 터미널에서 작동합니다. 예시 프롬프트: "SwiftUI iOS 앱, AES-256-GCM 암호화와 PBKDF2, 입력/복호화 화면."
  • Mac이 없는 프로그래머: 자신의 Swift 코드 + AI가 인프라(XcodeGen, GitHub Actions, 인증서)를 설정합니다.
  • 하드코어: 수동 프로젝트 구조, YAML 설정, 파이프라인. 로컬 미리보기 없이 TestFlight를 통한 반복.

Claude Code 설치:

npm install -g @anthropic-ai/claude-code
claude

AI가 파일을 생성하고 피드백을 바탕으로 편집합니다. 미리보기는 없지만 클라우드 빌드가 이를 보완합니다.

1단계: 러시아에서 Apple Developer 계정 만들기

appleid.apple.com에서 Apple ID 생성(국가 ≠ 러시아). developer.apple.com/programs/enroll에서 Individual로 등록합니다. 연간 $99 결제—해외 카드(Bybit 등) 사용. 24–48시간 내에 App Store Connect 접근 가능.

Google AdInline article slot

2단계: 프로젝트 구조와 XcodeGen

XcodeGen은 Xcode 없이 project.yml에서 .xcodeproj를 생성합니다. 예시 설정:

name: DarkMessage
options:
  bundleIdPrefix: com.darkmessage
  deploymentTarget:
    iOS: "15.0"
  xcodeVersion: "15.0"
targets:
  DarkMessage:
    type: application
    platform: iOS
    sources:
      - path: Sources
    resources:
      - path: Resources
    settings:
      base:
        PRODUCT_BUNDLE_IDENTIFIER: com.darkmessage.ios
        MARKETING_VERSION: "1.0.0"
        CURRENT_PROJECT_VERSION: "1"
        SWIFT_VERSION: "5.9"
        TARGETED_DEVICE_FAMILY: "1,2"
        INFOPLIST_VALUES:
          UILaunchScreen: {}
    dependencies: []

저장소 구조:

  • Sources/: App.swift, Views/, Models/, Services/ (CryptoService.swift).
  • Resources/Assets.xcassets/.
  • project.yml.
  • .github/workflows/build.yml.

YAML 장점: 간결(30줄), Git 충돌 없음, VS Code에서 편집 가능.

Google AdInline article slot

3단계: 저장소와 GitHub Actions

초기화:

git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/user/repo.git
git push -u origin main

macOS Actions 러너가 프로젝트를 빌드합니다: xcodegen generate, xcodebuild, 서명, TestFlight/App Store 업로드.

4단계: Mac 없이 코드 서명하기

필요 사항:

  • 배포 인증서 (.p12).
  • 프로비저닝 프로파일 (.mobileprovision).
  • App Store Connect API 키.

Windows에서 OpenSSL로 CSR 생성:

openssl genrsa -out ios_dist.key 2048
openssl req -new -key ios_dist.key -out ios_dist.csr -subj "/CN=Your Name/[email protected]"

CSR을 developer.apple.com/account/resources/certificates에 업로드 → Apple Distribution → .cer 다운로드. .p12로 변환:

openssl x509 -inform der -in ios_dist.cer -inkey ios_dist.key -out ios_dist.p12

프로비저닝 프로파일: developer.apple.com → Profiles → + → App Store → 번들 ID → 인증서.

API 키: App Store Connect → Users and Access → Keys → + → App Manager.

GitHub Settings → Secrets에 비밀 저장: CERTIFICATE_P12_BASE64, PROVISIONING_PROFILE_BASE64, APPSTORE_API_KEY.

5단계: CI/CD를 위한 워크플로 YAML

예시 .github/workflows/build.yml (단순화):

name: Build iOS
on: [push]
jobs:
  build:
    runs-on: macos-13
    steps:
      - uses: actions/checkout@v4
      - name: Generate Xcode project
        uses: maxim-lobanov/setup-xcodegen@v1
        with:
          xcodegen-version: '2.35.0'
      - run: xcodegen generate
      - name: Import certificate
        env:
          CERTIFICATE_P12: ${{ secrets.CERTIFICATE_P12_BASE64 }}
        run: |
          echo $CERTIFICATE_P12 | base64 --decode > cert.p12
          security import cert.p12 -k ~/Library/Keychains/login.keychain
      # ... signing, archive, upload

전체 워크플로에는 App Store용 xcodebuild archive, xcrun altool 또는 xcrun notarytool이 포함됩니다.

핵심 포인트

  • GitHub Actions macOS는 공개 저장소에 무료(월 2000분).
  • XcodeGen은 Xcode 없이 프로젝트 관리를 단순화합니다.
  • 코드 서명은 base64 인코딩된 비밀을 통해 자동화됩니다.
  • 반복: 푸시부터 TestFlight까지 15분.
  • 일회성 프로젝트에 적합; 프로덕션에는 Mac이 개발 속도를 높입니다.

— Editorial Team

Advertisement 728x90

다음 읽기