using-xtool
Xcodeを使わずにiOSアプリを開発するxtoolプロジェクトの作成、設定、アプリ拡張機能の追加を支援するSkill。
📜 元の英語説明(参考)
This skill should be used when building iOS apps with xtool (Xcode-free iOS development), creating xtool projects, adding app extensions, or configuring xtool.yml. Triggers on "xtool", "SwiftPM iOS", "iOS on Linux", "iOS on Windows", "Xcode-free", "app extension", "widget extension", "share extension". Covers project setup, app extensions, and deployment.
🇯🇵 日本人クリエイター向け解説
Xcodeを使わずにiOSアプリを開発するxtoolプロジェクトの作成、設定、アプリ拡張機能の追加を支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] using-xtool
xtool の使用
概要
xtool は、Linux、Windows、macOS で SwiftPM を使用して iOS アプリをビルドするための、クロスプラットフォームの Xcode 代替ツールです。XcodeGen、Tuist、または Xcode プロジェクトファイルではありません。
重要: xtool は XcodeGen ではありません
| xtool が使用するもの | これらは使用しません |
|---|---|
xtool.yml |
project.yml、Project.swift |
Package.swift (SwiftPM) |
Xcode プロジェクトファイル |
xtool dev |
xtool build、xtool run、xtool generate |
Sources/ ディレクトリ |
Extensions/ ディレクトリ |
プロジェクト構造
MyApp/
├── Package.swift # SwiftPM パッケージ定義
├── xtool.yml # xtool 設定
├── Sources/
│ ├── MyApp/ # メインアプリターゲット
│ │ ├── MyAppApp.swift
│ │ └── ContentView.swift
│ └── MyWidget/ # 拡張機能ターゲット (もしあれば)
│ └── Widget.swift
├── MyApp-Info.plist # オプションのカスタム Info.plist
└── MyWidget-Info.plist # 拡張機能に必須
クイックリファレンス: コマンド
# プロジェクトライフサイクル
xtool new MyApp # 新しいプロジェクトを作成
xtool new MyApp --skip-setup # セットアップを実行せずに作成
xtool dev # ビルド + 実行 (`xtool dev run` と同じ)
xtool dev build # ビルドのみ
xtool dev build --ipa # IPA ファイルをビルド
xtool dev run -s # iOS シミュレーターで実行 (--simulator)
xtool dev run -c release # リリースビルド (--configuration)
xtool dev run -u <udid> # 特定のデバイスをターゲット (--udid)
xtool dev generate-xcode-project # デバッグ用に .xcodeproj を生成
# デバイス管理
xtool devices # 接続されているデバイスを一覧表示
xtool install app.ipa # IPA をデバイスにインストール
xtool launch # インストールされたアプリを起動
xtool uninstall # デバイスからアプリをアンインストール
# 認証とセットアップ
xtool setup # フルセットアップ (認証 + SDK)
xtool auth login # Apple で認証
xtool auth status # 認証ステータスを確認
xtool auth logout # ログアウト
xtool sdk # Darwin Swift SDK を管理
# 開発者サービス
xtool ds teams # 開発チームを一覧表示
xtool ds certificates # 証明書を管理
xtool ds profiles # プロビジョニングプロファイルを管理
xtool.yml 形式
最小限:
version: 1
bundleID: com.example.MyApp
フルオプション:
version: 1
bundleID: com.example.MyApp
product: MyApp # メインアプリとなる SwiftPM プロダクト
infoPath: MyApp-Info.plist # カスタム Info.plist (マージされます)
iconPath: Resources/AppIcon.png # アプリアイコン (1024x1024 PNG)
entitlementsPath: App.entitlements
resources: # アプリバンドルのルートにコピーされるファイル
- Resources/GoogleServices-Info.plist
extensions: # アプリ拡張機能
- product: MyWidget
infoPath: MyWidget-Info.plist
アプリ拡張機能 (ウィジェット、共有など) の追加
ステップ 1: Package.swift を更新する
プロダクトとターゲットの両方を追加します。注: xtool は .library (.executable ではない) を使用します。これはライブラリを iOS アプリにバンドルします。
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "MyApp",
platforms: [.iOS(.v17)],
products: [
.library(name: "MyApp", targets: ["MyApp"]),
.library(name: "MyWidget", targets: ["MyWidget"]), // 追加
],
targets: [
.target(name: "MyApp"),
.target(name: "MyWidget"), // 追加
]
)
ステップ 2: xtool.yml を更新する
version: 1
bundleID: com.example.MyApp
product: MyApp
extensions:
- product: MyWidget
infoPath: MyWidget-Info.plist
ステップ 3: 拡張機能の Info.plist を作成する
最小限必要なもの (拡張機能のタイプのみ):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>
ステップ 4: 拡張機能のコードを作成する
Sources/MyWidget/Widget.swift:
import WidgetKit
import SwiftUI
@main struct MyWidgetBundle: WidgetBundle {
var body: some Widget { MyWidget() }
}
struct MyWidget: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: "MyWidget", provider: Provider()) { entry in
Text(entry.date, style: .date)
.containerBackground(.fill.tertiary, for: .widget)
}
.configurationDisplayName("My Widget")
}
}
struct Entry: TimelineEntry { var date = Date() }
struct Provider: TimelineProvider {
func placeholder(in context: Context) -> Entry { Entry() }
func getSnapshot(in context: Context, completion: @escaping (Entry) -> Void) {
completion(Entry())
}
func getTimeline(in context: Context, completion: @escaping (Entry) -> Void) {
completion(Timeline(entries: [Entry()], policy: .after(.now + 3600)))
}
}
ステップ 5: ビルドして実行する
xtool dev
一般的な拡張機能のタイプ
| 拡張機能 | NSExtensionPointIdentifier |
|---|---|
| Widget (WidgetKit) | com.apple.widgetkit-extension |
| Share | com.apple.share-services |
| Action | com.apple.ui-services |
| Safari | com.apple.Safari.web-extension |
| Keyboard | com.apple.keyboard-service |
| Today (非推奨) | com.apple.widget-extension |
トラブルシューティング
| エラー | 解決策 |
|---|---|
| "信頼されていない開発元" | 設定 > 一般 > VPN とデバイス管理 > 信頼 |
| デバイスが見つからない | USB を接続し、xtool devices を実行し、開発者モードを有効にする |
| 認証失敗 | xtool auth login を実行する |
| 初回実行時にビルドが失敗する | 通常のことです。SDK モジュールがビルドされています。完了するまでお待ちください。 |
リソース設定
SwiftPM リソース (バンドルサブディレクトリ内):
.target(name: "MyApp", resources: [.copy("Blob.png")])
// アクセス: Image("Blob", bundle: Bundle.module)
トップレベルのリソース (アプリバンドルのルート内)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Using xtool
Overview
xtool is a cross-platform Xcode replacement for building iOS apps with SwiftPM on Linux, Windows, and macOS. It is NOT XcodeGen, Tuist, or Xcode project files.
Critical: xtool is NOT XcodeGen
| xtool Uses | NOT These |
|---|---|
xtool.yml |
project.yml, Project.swift |
Package.swift (SwiftPM) |
Xcode project files |
xtool dev |
xtool build, xtool run, xtool generate |
Sources/ directory |
Extensions/ directory |
Project Structure
MyApp/
├── Package.swift # SwiftPM package definition
├── xtool.yml # xtool configuration
├── Sources/
│ ├── MyApp/ # Main app target
│ │ ├── MyAppApp.swift
│ │ └── ContentView.swift
│ └── MyWidget/ # Extension target (if any)
│ └── Widget.swift
├── MyApp-Info.plist # Optional custom Info.plist
└── MyWidget-Info.plist # Required for extensions
Quick Reference: Commands
# Project lifecycle
xtool new MyApp # Create new project
xtool new MyApp --skip-setup # Create without running setup
xtool dev # Build + run (same as `xtool dev run`)
xtool dev build # Build only
xtool dev build --ipa # Build IPA file
xtool dev run -s # Run on iOS Simulator (--simulator)
xtool dev run -c release # Release build (--configuration)
xtool dev run -u <udid> # Target specific device (--udid)
xtool dev generate-xcode-project # Generate .xcodeproj for debugging
# Device management
xtool devices # List connected devices
xtool install app.ipa # Install IPA to device
xtool launch # Launch installed app
xtool uninstall # Uninstall app from device
# Authentication & setup
xtool setup # Full setup (auth + SDK)
xtool auth login # Authenticate with Apple
xtool auth status # Check auth status
xtool auth logout # Log out
xtool sdk # Manage Darwin Swift SDK
# Developer Services
xtool ds teams # List development teams
xtool ds certificates # Manage certificates
xtool ds profiles # Manage provisioning profiles
xtool.yml Format
Minimal:
version: 1
bundleID: com.example.MyApp
Full options:
version: 1
bundleID: com.example.MyApp
product: MyApp # Which SwiftPM product is main app
infoPath: MyApp-Info.plist # Custom Info.plist (merged)
iconPath: Resources/AppIcon.png # App icon (1024x1024 PNG)
entitlementsPath: App.entitlements
resources: # Files copied to app bundle root
- Resources/GoogleServices-Info.plist
extensions: # App extensions
- product: MyWidget
infoPath: MyWidget-Info.plist
Adding App Extensions (Widgets, Share, etc.)
Step 1: Update Package.swift
Add BOTH a product AND a target. Note: xtool uses .library (not .executable) - it bundles the library into an iOS app.
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "MyApp",
platforms: [.iOS(.v17)],
products: [
.library(name: "MyApp", targets: ["MyApp"]),
.library(name: "MyWidget", targets: ["MyWidget"]), // ADD
],
targets: [
.target(name: "MyApp"),
.target(name: "MyWidget"), // ADD
]
)
Step 2: Update xtool.yml
version: 1
bundleID: com.example.MyApp
product: MyApp
extensions:
- product: MyWidget
infoPath: MyWidget-Info.plist
Step 3: Create Extension Info.plist
Minimal required (just the extension type):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>
Step 4: Create Extension Code
Sources/MyWidget/Widget.swift:
import WidgetKit
import SwiftUI
@main struct MyWidgetBundle: WidgetBundle {
var body: some Widget { MyWidget() }
}
struct MyWidget: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: "MyWidget", provider: Provider()) { entry in
Text(entry.date, style: .date)
.containerBackground(.fill.tertiary, for: .widget)
}
.configurationDisplayName("My Widget")
}
}
struct Entry: TimelineEntry { var date = Date() }
struct Provider: TimelineProvider {
func placeholder(in context: Context) -> Entry { Entry() }
func getSnapshot(in context: Context, completion: @escaping (Entry) -> Void) {
completion(Entry())
}
func getTimeline(in context: Context, completion: @escaping (Entry) -> Void) {
completion(Timeline(entries: [Entry()], policy: .after(.now + 3600)))
}
}
Step 5: Build and Run
xtool dev
Common Extension Types
| Extension | NSExtensionPointIdentifier |
|---|---|
| Widget (WidgetKit) | com.apple.widgetkit-extension |
| Share | com.apple.share-services |
| Action | com.apple.ui-services |
| Safari | com.apple.Safari.web-extension |
| Keyboard | com.apple.keyboard-service |
| Today (deprecated) | com.apple.widget-extension |
Troubleshooting
| Error | Solution |
|---|---|
| "Untrusted Developer" | Settings > General > VPN & Device Management > Trust |
| Device not found | Connect USB, run xtool devices, enable Developer Mode |
| Auth failed | Run xtool auth login |
| Build fails on first run | Normal - SDK modules building. Wait for completion. |
Resources Configuration
SwiftPM resources (in bundle subdirectory):
.target(name: "MyApp", resources: [.copy("Blob.png")])
// Access: Image("Blob", bundle: Bundle.module)
Top-level resources (in app bundle root):
# xtool.yml
resources:
- Resources/GoogleServices-Info.plist
Entitlements
# xtool.yml
entitlementsPath: App.entitlements
<!-- App.entitlements -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.homekit</key>
<true/>
</dict>
</plist>
Common Mistakes
| Mistake | Fix |
|---|---|
Using xtool build |
Use xtool dev build |
Using project.yml |
Use xtool.yml |
Using Extensions/ dir |
Use Sources/ (standard SwiftPM) |
| Forgetting Package.swift | Extensions need product + target in Package.swift |
| Complex extension Info.plist | Only NSExtension/NSExtensionPointIdentifier required |