AgentSkillsCN

apple-developer

使用Swift、SwiftUI与Xcode为苹果平台开发应用。在为iOS、iPadOS、macOS、tvOS、visionOS或watchOS开发应用、实现Apple Intelligence功能,或通过TestFlight与App Store进行分发时使用。

SKILL.md
--- frontmatter
name: apple-developer
description: Build apps for Apple platforms using Swift, SwiftUI, and Xcode. Use when developing for iOS, iPadOS, macOS, tvOS, visionOS, or watchOS, implementing Apple Intelligence features, or distributing via TestFlight and App Store.

Apple Developer Skill

Build apps for all Apple platforms.

Advanced References

Platforms

PlatformUse Case
iOSiPhone apps
iPadOSiPad apps
macOSMac desktop apps
tvOSApple TV apps
visionOSVision Pro spatial apps
watchOSApple Watch apps

Tools

  • Xcode - Primary IDE
  • Swift - Programming language
  • SwiftUI - Declarative UI framework
  • TestFlight - Beta testing
  • Xcode Cloud - CI/CD

SwiftUI Basics

swift
import SwiftUI

struct ContentView: View {
    @State private var count = 0
    
    var body: some View {
        VStack {
            Text("Count: \(count)")
                .font(.largeTitle)
            
            Button("Increment") {
                count += 1
            }
            .buttonStyle(.borderedProminent)
        }
        .padding()
    }
}

#Preview {
    ContentView()
}

Project Structure

text
MyApp/
├── MyApp.xcodeproj
├── MyApp/
│   ├── MyAppApp.swift      # App entry point
│   ├── ContentView.swift   # Main view
│   ├── Assets.xcassets     # Images, colors
│   └── Info.plist          # App configuration
└── MyAppTests/

Apple Intelligence

Integrate on-device AI:

  • Siri integration
  • App Intents
  • Natural language processing
  • Image analysis

App Distribution

TestFlight

  1. Archive app in Xcode
  2. Upload to App Store Connect
  3. Add testers (internal/external)
  4. Distribute beta builds

App Store

  1. Create app in App Store Connect
  2. Configure metadata, screenshots
  3. Submit for review
  4. Release to users

Common Commands

bash
# Build from command line
xcodebuild -scheme MyApp -configuration Release

# Run tests
xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'

# Archive for distribution
xcodebuild archive -scheme MyApp -archivePath ./build/MyApp.xcarchive