bokuwalily/claude-code-skills/xcodegen-storekit2-local-test

Claude Code and agent skill by bokuwalily/claude-code-skills

Trust tier 3
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

XcodeGen (2.45.4+) で StoreKit2 ローカルテスト設定を行うパターン。.storekit ファイルを project.yml に `storeKitConfiguration` で紐付け、実機課金なしで IAP ゲートを検証する。IAP付きiOSアプリで確立した手順。

Install

npx vskill@latest install bokuwalily/claude-code-skills/xcodegen-storekit2-local-test

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as bokuwalily/claude-code-skills/xcodegen-storekit2-local-test.

問題

StoreKit2 の IAP(in-app purchase)フローを CI / 開発中にテストしたい場合、実機 Apple ID 課金なしで動作確認するには .storekit 設定ファイルを Xcode に紐付ける必要がある。XcodeGen を使っているプロジェクトでは project.yml 経由でこの設定を行う。公式ドキュメントには XcodeGen 連携手順がほぼ存在しない。

前提

  • XcodeGen ≥ 2.45.4(storeKitConfiguration フィールドが安定サポートされたバージョン)
  • Xcode ≥ 15(StoreKit Testing in Xcode 対応)
  • .storekit ファイルが既にプロジェクトルートに存在すること(なければ Xcode の File > New > StoreKit Configuration File で作成)

Procedure

1. .storekit ファイルを作成・配置する
ProjectRoot/
├── project.yml
├── Foo.storekit ← ここに配置
└── Sources/

Xcode で作成する場合: File → New → File → StoreKit Configuration File

ファイル内で IAP 商品を定義する(例: Premium 購読):

json
{
"identifier" : "com.example.app.premium",
"type" : "Non-Consumable",
"referenceName" : "Premium Unlock",
"localizations" : [
{
"displayName" : "プレミアム",
"locale" : "ja_JP"
}
]
}
2. project.yml に storeKitConfiguration を追加する
yaml
targets:
MyApp:
type: application
platform: iOS
deploymentTarget: "17.0"
sources:
- Sources
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: com.example.myapp
scheme:
storeKitConfiguration: Foo.storekit # ← これを追加

注意点:

  • キー名は storeKitConfiguration(camelCase・スペルミス注意。storekit_configuration や storekitConfiguration は無効)
  • 値はプロジェクトルートからの相対パス
  • scheme: の下に置く(settings.base の下ではない)
3. XcodeGen を実行してプロジェクトを再生成する
bash
# XcodeGen 未インストールなら
brew install xcodegen
# プロジェクトルートで実行
xcodegen generate
4. Xcode で StoreKit テスト設定を確認する
  1. 生成された .xcodeproj を開く
  2. Product → Scheme → Edit Scheme → Run → Options タブを開く
  3. StoreKit Configuration に Foo.storekit が自動選択されていることを確認

選択されていなければ手動でドロップダウンから選ぶ(project.yml 側の設定ミスの可能性)。

5. シミュレータで IAP をテストする
swift
// StoreKit2 API でのテスト例
let products = try await Product.products(for: ["com.example.app.premium"])
let result = try await products.first?.purchase()

.storekit ファイルが有効な場合、シミュレータ上で購入ダイアログが表示され、「Ask to Buy」等のサンドボックス動作を確認できる。

Pitfalls

症状原因対処
storeKitConfiguration が scheme に反映されないXcodeGen < 2.45.4brew upgrade xcodegen
ビルド後に設定が消えるxcodegen generate を忘れてた手動編集必ず xcodegen generate 経由で変更する
.storekit パスが見つからない相対パスミス or ファイル未コミットls -la *.storekit で確認
シミュレータで IAP ダイアログが出ないScheme の StoreKit Configuration が未選択Edit Scheme → Options で手動選択
iPhone 16 シミュレータが存在しないXcode デフォルトシミュレータ未作成`xcrun simctl create "iPhone 16" com.apple.CoreSimulator.SimDeviceType.iPhone-16 $(xcrun simctl list runtimesgrep iOStail -1awk '{print $NF}')`

Verification

bash
# project.yml に storeKitConfiguration が含まれているか
grep -n "storeKitConfiguration" project.yml
# .storekit ファイルが存在するか
ls *.storekit
# XcodeGen バージョン確認
xcodegen --version # 2.45.4 以上であること
# 生成された xcscheme に設定が反映されているか
grep -r "StoreKitConfigurationFileReference" *.xcodeproj/xcuserdata/ 2>/dev/null || \
grep -r "StoreKitConfigurationFileReference" *.xcodeproj/xcshareddata/ 2>/dev/null

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bokuwalily/claude-code-skills/xcodegen-storekit2-local-test/badge)](https://verified-skill.com/skills/bokuwalily/claude-code-skills/xcodegen-storekit2-local-test)

Something wrong with this skill or its page? Tell us.