Build an iOS12.2 application with Xcode 10.2 on High Sierra
I am using NVIDIA GPU for Machine Learning on old Mac Pro 2010. However if I update my mac to Mojave, no NVIDIA driver is available for the present.
But I want use the Mac for the latest iOS development, and Xcode 10.2+ on my High Sierra mac. I found a way to use Xcode 10.2.1 on High Sierra. I’d like to share the way.
You need a developper account for download Xcode 10.2.1. You can find it at the link More Downloads for Apple Developers.
After download it, change the directory name for Xcode 10.1 to Xcode10.1 etc.
You need to modify three info.plist wtih Xcode 10.1. They are in the following folders.
- /Volumes/your system drive/Applications/Xcode.app/Contents
- /Volumes/your system drive/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/
- /Volumes/RAIDZero/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents
They all have ‘Minimum system version,’ each value is 10.14.3 or 10.4(for Simulator). Modify them to 10.13.6 or 10.3(for simulator).
Then boot the Xcode 10.2.1. You will be asked to download other tools. Of course, do that.
You have some iOS projects can be used for a test. Check if the project target version can be up to 12.2. Build the project and run it on a simulator.
When finished checking if the project work on the simulator, check the version of the simulator’s verision is 12.2.
Then connect your iOS device to your High Sierra mac, choose the device as the target for build. And check the project works properly.
In my environment, iPhone 5s with iOS 12.2 works well.
I don’t know whether Apple will accept the app built with High Sierra mac. If not, you need a Mojeva mac to pass.
I wrote this way on the Stack Overflow as Tripod.
参考にさせて頂きXcode 10.2.1で試したところ、下記のメッセージが表示され
起動しません。何かしら追加で変更が必要でしたらアドバイスをお願い致します。
このバージョンのアプリケーション“Xcode”は、このバージョンのmacOSでは使用できません。macOS 10.13.6を使用しています。このアプリケーションを使用するにはmacOS 10.14.6以降が必要です。
コメントありがとうございます。
Xcodeの起動ですが、Terminal(コンソール)からやるとそのエラーが出るのではと思います。Finderからアイコンをダブルクリックで実行すると問題なく起動するはずですが。お試し頂けるでしょうか?
gitなどのツールもXcodeのGUI内では動作させられますが、やはりTerminalで実行しようとすると同じエラーが出ます。
今回のやり方はあくまでもMojaveを使いたくないがiOS12.2プロジェクトのビルドはしたいiOSデベロッパー向けのものですね。特にNVIDIAのグラボを搭載しているとMojaveではDriverがないんですよ・・・。
追加情報
上記でダメならStack Overflowの方で私の投稿に対するコメントにあった
sudo xcode-select -s /Applications/Xcode旧バージョン.app/Contents/Developer
をTerminalで実行してみてはどうでしょう?これではgitなどのコンソールアプリケーションも動作させられ、必要に応じてxcodebuildなどのバージョンを可逆的に変更できます。
このcommandで新しいXcode 10.2.1かXcode旧バージョン、どちらに設定してもうちではFinder起動したXcodeアプリケーション上でビルドターゲットをiOS12.2にしてご指摘のエラーなしに実機iPhoneで対象プロジェクトをビルド実行できるようです。
あと、特定のプロジェクト(設定)で出ると言うことが考えられなくはないので、新規プロジェクト作成してビルドするとOKと言う場合もあります。
いずれにせよTOMさんの設定が分からない段階で考えられるのは上の解決法くらいでしょうか。
xcodebuildもバージョン制限に引っかかるようで最初の使用承諾でひっかかります。これは古いバージョンを先に入れておくとかすると回避できるんでしょうか?あるいはxcodebuildのバージョン制限変更方法があるとか?
コメントありがとうございます。
基本的にターミナルで行う操作はアウトだと思っていた方がいいでしょう。
このレシピはあくまでもXcodeのmacOSのウインドウが開くタイプのアプリケーションを「騙す」ためのものです。
Stack Overflowの方の私(tripod)のコメントに対する応答にあるようにgitなどもターミナルでは動作させられません。(GitHub関連、ウインドウが開くタイプのアプリケーションでは問題ありません。)
同じ人がコメントしているように
sudo xcode-select -s /Applications/Xcode-10-1.app/Contents/Developer (インストールディレクトリに依存します。)
を実行すればターミナル上では旧バージョンのコマンドラインツール類が動作させられます。新しい方へもどすのはディレクトリ、ファイル名を新しい方にしてやればいいです。
ただiOS12.2向けのプロジェクトを作成、デバイスへインストールする必要がありましたらコマンドラインではなく、ウインドウの開くタイプのアプリケーションでやる必要があるのではと思います。
以上、よろしくお願いします。