Private
Public Access
1
0

ios_app を追加

2025-12-22 19:11:57 +00:00
parent f2aaa423e0
commit e64a6bb064

285
ios_app.md Normal file

@@ -0,0 +1,285 @@
# iOS App Store ビルドガイド
UE5プロジェクトをiOS App Storeにアップロードするための手順。
## 必要なもの
### Apple Developer 証明書
| 証明書 | 用途 |
|--------|------|
| Apple Distribution | アプリ署名 |
確認方法:
```bash
security find-identity -v -p codesigning
```
### Provisioning Profile
1. [Apple Developer](https://developer.apple.com/account/resources/profiles/list) からダウンロード
2. プロジェクトルートに `embedded.mobileprovision` として配置
```bash
# 内容確認
security cms -D -i embedded.mobileprovision
```
### App Store Connect API Key
1. [App Store Connect](https://appstoreconnect.apple.com/access/integrations/api) で作成
2. `.p8` ファイルをダウンロード
3. Issuer ID と Key ID をメモ
## 設定ファイル
### .env
```bash
# 署名証明書
IOS_CERTIFICATE_NAME="Apple Distribution: Your Name (TEAMID)"
DEVELOPMENT_TEAM="TEAMID"
# iOS Provisioning Profile
MOBILEPROVISION="/path/to/embedded.mobileprovision"
# App Store Connect API
ASC_ISSUER_ID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
ASC_KEY_ID="XXXXXXXXXX"
ASC_KEY_PATH="/path/to/XXXXXXXXXX.p8"
```
### Config/DefaultEngine.ini
```ini
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
BundleDisplayName=AppName
BundleIdentifier=com.example.app
IOSTeamID=TEAMID
BundleName=com.example.app
MetalLanguageVersion=7
MinimumiOSVersion=IOS_17
bAutomaticSigning=True
bSupportsPortraitOrientation=True
bSupportsLandscapeLeftOrientation=False
bSupportsLandscapeRightOrientation=False
```
## ビルドワークフロー
```bash
# 1. iOSビルド
./bin/build.zsh ios
# 2. IPA作成署名
./bin/build.zsh ipa
# 3. App Storeにアップロード
./bin/build.zsh upload-ios
```
## コマンド詳細
### ios - UE5ビルド
```bash
./bin/build.zsh ios
```
実行内容:
- BuildCookRun でiOS向けビルド
- `-iterate` で増分クック(高速化)
- 出力: `IOS/*.xcarchive`
### ipa - IPA作成
```bash
./bin/build.zsh ipa
```
実行内容:
1. 最新の xcarchive を検出
2. Payload フォルダに .app をコピー
3. embedded.mobileprovision を埋め込み
4. Entitlements を抽出
5. Frameworks を署名
6. メインアプリを署名
7. ZIP圧縮して .ipa を生成
8. 出力: `build/Airse.ipa`
### upload-ios - アップロード
```bash
./bin/build.zsh upload-ios
```
実行内容:
- `xcrun altool` でApp Store Connectにアップロード
- API Key認証推奨またはユーザー名/パスワード認証
## 必須ファイル
```
Project/
├── .env # 環境変数
├── embedded.mobileprovision # iOS用プロビジョニングプロファイル
├── XXXXXXXXXX.p8 # App Store Connect API Key
├── Build/
│ └── IOS/
│ └── Resources/
│ └── Assets.xcassets/
│ └── AppIcon.appiconset/ # アプリアイコン
└── Config/
└── DefaultEngine.ini # プロジェクト設定
```
## アイコン設定
### アイコン生成
```bash
./bin/build.zsh icon [source_image.png]
```
デフォルトソース: `bin/icon/airse.png`
生成先: `Build/IOS/Resources/Assets.xcassets/AppIcon.appiconset/`
### 必要なアイコンサイズ
| ファイル名 | サイズ | 用途 |
|-----------|--------|------|
| IPhoneIcon60@2x.png | 120x120 | iPhone |
| IPadIcon76@2x.png | 152x152 | iPad |
| IPadIcon83.5@2x.png | 167x167 | iPad Pro |
| Icon1024.png | 1024x1024 | App Store |
## トラブルシューティング
### No valid iOS code signing certificates found
**原因**: Apple Distribution証明書がない
**解決**:
1. Keychain Access で証明書を確認
2. なければ Apple Developer から作成・ダウンロード
### mobileprovision not found
**原因**: Provisioning Profileが配置されていない
**解決**:
```bash
# Apple Developer からダウンロードして配置
cp ~/Downloads/profile.mobileprovision embedded.mobileprovision
```
### The bundle identifier does not match
**原因**: Bundle IDがProvisioning Profileと一致しない
**解決**:
1. `DefaultEngine.ini``BundleIdentifier` を確認
2. Provisioning Profileが正しいBundle IDで作成されているか確認
### クック失敗 (ExitCode=25)
**原因**: アセットのクックエラー
**解決**:
1. `-iterate` を外してフルクック
2. エラーログを確認: `build_ios.log`
### アップロード失敗
**原因**: API Keyの設定ミス
**解決**:
1. `.env` の ASC_* 変数を確認
2. `.p8` ファイルのパスを確認
3. altool は `AuthKey_<KEY_ID>.p8` という名前を期待する
## 署名の仕組み
### 手動署名フロー
```
1. Provisioning Profile から Entitlements を抽出
security cms -D -i embedded.mobileprovision > profile.plist
PlistBuddy -x -c "Print :Entitlements" profile.plist > entitlements.plist
2. Frameworks を署名(あれば)
codesign -f -s "$CERT" Framework.framework
3. メインアプリを署名
codesign -f -s "$CERT" --entitlements entitlements.plist App.app
4. IPA作成
zip -r App.ipa Payload/
```
### 自動署名 vs 手動署名
| 項目 | 自動署名 | 手動署名 |
|------|---------|---------|
| 設定 | `bAutomaticSigning=True` | `bAutomaticSigning=False` |
| Profile | Xcode管理 | 手動配置 |
| 柔軟性 | 低 | 高 |
| CI/CD | 困難 | 容易 |
## デバイス要件
### 最小iOSバージョン
`DefaultEngine.ini`:
```ini
MinimumiOSVersion=IOS_17
```
選択肢:
- `IOS_15` - iOS 15以上
- `IOS_16` - iOS 16以上
- `IOS_17` - iOS 17以上推奨
### 対応向き
```ini
bSupportsPortraitOrientation=True
bSupportsLandscapeLeftOrientation=False
bSupportsLandscapeRightOrientation=False
```
## ビルドログ
ログファイルの場所:
- UE5ビルドログ: `build_ios.log`
- Xcodeログ: `~/Library/Logs/Unreal Engine/LocalBuildLogs/`
## Mac vs iOS の違い
| 項目 | Mac | iOS |
|------|-----|-----|
| 出力形式 | .pkg | .ipa |
| Profile | .provisionprofile | .mobileprovision |
| Sandbox | 必須EpicWebHelper署名 | 不要 |
| Assets.car | 再ビルド必要 | UE5が生成 |
| アップロード | `-t macos` | `-t ios` |
## 参考コマンド
```bash
# 証明書一覧
security find-identity -v -p codesigning
# Provisioning profile の内容確認
security cms -D -i embedded.mobileprovision
# IPA の内容確認
unzip -l Airse.ipa
# アプリの署名確認
codesign -dv --verbose=4 Payload/Airse.app
# Entitlements 確認
codesign -d --entitlements - Payload/Airse.app
```