LoginSignup
0
0

More than 3 years have passed since last update.

【ReactNative】Could not find iPhone X simulatorエラーの解決

Last updated at Posted at 2019-12-06

エラーについて

Found Xcode workspace sample.xcworkspace

Could not find iPhone X simulator

Error: Could not find iPhone X simulator

Xcode11でこの問題で少し詰まったので、メモ。
Simulatorアプリでいくらターゲットのsimulatorを追加しても
うまくいかなかったのですが、下記の方法で改善しました。

*ReactNative v0.59.8

◆対策

/node_modules/react-native/local-cli/runIOS/findMatchinSimuilator.jsの62行目あたり

if(simulator.availability !== '(available)' &&
        simulator.isAvailable !== 'YES' ){

という部分の条件分岐を

if(simulator.availability !== '(available)' &&
        simulator.isAvailable !== 'YES' && 
        simulator.isAvailable !== true){  //    <- この行

へ変更。

◆原因

xcode側の実装が変わっており、デバイス毎に以下のような
ステータスを持っているが、その中のisAvailableの変数が
String → Boolean に変わったようです。

{ state: 'Shutdown',
       isAvailable: false,
       name: 'iPhone X',
       udid: 'F15B13D6-4E4C-4047-84DA-0361220016D5',
       availabilityError: 'runtime profile not found' }

なのでbooleanでtrueの場合も真の処理を通してあげる修正を入れてあげると動作します。

0
0
2

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
0
0