こんにちは!
この記事では、Xcodeでx64とarm64に対応した.app
を書き出す方法を紹介します!
(2024年06月19日 時点)
テスト環境
- Xcode 16.0.0 Beta1 (おそらく、Xcode 15でも同じ)
- Mac mini (2023, 32GB-RAM)
仕組み
XcodeのArchive機能では、App Store Connectにアプリをアップロードしたりできます。
そのアプリは、.xcarchive
拡張子のファイルに入っています。
ということは、arm64とx86_64のどちらにも対応しているBuildとしてArchiveし、
その中の.app
拡張子を取り出せばいいという発想です。
(2024年06月19日 時点では成功)
注意
AppleシリコンのMacで動作確認しています。
Intelでの動作はできるか分かりません。
手順
Any Mac (arm64, x86_64)に設定
Archive
Finderで表示
↑ Finderで.xcarchive
拡張子のファイルを表示
.app
拡張子のファイルを取り出す
↑ 現在の状態からProducts/Applications
に移動し、IntelとAppleシリコンのMacに対応したアプリをコピー
(注意: Universal == AppleシリコンとIntelチップのMacに対応
ということです)
好きなところにペースト
好きなところにペースト
以上
どうでしょうか?
うまく.appを書き出せましたか?
この方法を使えば、AppleシリコンとIntelチップのMac用に1つのアプリファイルを配布するだけでいいですね!
それではまた他の記事で!