はこねのはこ

はこねさんの備忘録

A build only device cannot be used to run this targetのエラーが場合

はじめに

ほぼ一年ぶりにXcodeをビルドして、実機デバッグしようとしたら、 A build only device cannot be used to run this targetというエラーが出たので 対処方法をメモしておきます

f:id:hakonebox:20180329213841p:plain

環境

対処方法

  1. Simulatorを開く Xcode→Open Developer→Simulatorでシミュレータを起動します。 f:id:hakonebox:20180329214150p:plain iPhone XのSimulatorが立ち上がりました。 Xcodeのアップデートで設定が変わってしまったのでしょうか? f:id:hakonebox:20180329214335p:plain

  2. 使用する機種を選択する HardWare→Device→iOS x.x→iPhone SE f:id:hakonebox:20180329214719p:plain iPhone SEのSimulatorが立ち上がりました。 f:id:hakonebox:20180329215121p:plain しばらく見ない間にデザイン変わってますね。

実機でアプリをタップしてみる

信用されていないデベロッパと出てしまいました。

設定→一般→プロファイルとデバイス管理→デベロッパAPP ここから信用しましょう。

できました。

無事実機でデバッグできました。