LoginSignup
2
0

More than 5 years have passed since last update.

Ionic3でiOSビルド時に「Error: Command failed: xcrun simctl list --json」エラーが発生した時の対処方法

Last updated at Posted at 2018-04-20

:one: 環境

  • OS: macOS High Sierra 10.13.4
  • Xcode: 9.3 Build version 9E145
  • Node.js: v8.9.3
  • npm: v5.6.0
  • cordova: v7.1.0
  • Ionic: 3.20.0
  • cordova-ios: 4.5.4

:two: エラー内容

ionic cordova build ios --prod --releaseコマンドを実行すると以下のエラー内容が表示された。

エラー内容
Error: Command failed: xcrun simctl list --json
dyld: Symbol not found: _SimDeviceBootKeyDisabledJobs
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/simctl
  Expected in: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
 in /Applications/Xcode.app/Contents/Developer/usr/bin/simctl

:three: 原因

正確な原因は不明。

エラー内容にあるxcrun simctlはシミュレータ関連のコマンドらしく、「Xcodeを起動して最新状態にするとイイよ!」って記事は見つけたのでsimctlコマンドが古いことで発生したと思われる。
https://forum.ionicframework.com/t/ios-build-error-error-command-failed-xcrun-simctl-list-json/108031

ただ、元々エミュレータ用にビルドするつもりは無く、デバイス用にビルドしたかったため ionic cordova build コマンドの公式リファレンスを調べたところ、デバイス用にビルドするコマンドオプションとして--deviceが必要なことが分かった。

:four: 対応

4.1 エミュレータ用ビルドで発生していたエラーの対応

エミュレータ用ビルドで発生していたエラーは、Xcodeを起動することで最新の状態にして ionic cordova build ios --prod --release コマンドを実行してエラー無く完了することを確認した。

4.2 デバイス用にビルドする方法

元々エミュレータ用ビルドではなく、デバイス用にビルドしたかったため以下のようにコマンドを変更した。

変更前のコマンド・・・エミュレータ用にビルド
ionic cordova build ios --prod --release
変更後のコマンド・・・デバイス用にビルド
ionic cordova build ios --prod --release --device
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0