LoginSignup
9
10

More than 5 years have passed since last update.

linker command failed with exit code 1 (use -v to see invocation) でシミュレータが使えない

Posted at

CocoaPods を導入後、
linker command failed with exit code 1 (use -v to see invocation)
というエラーが吐き出されて、
iPhone などの実機ではデバッグ、実行出来ますが
iOS シミュレータでデバッグ、実行することが出来なくなってしまいました。
なぜこのような事態になったかはわかりませんが、解決方法を書いておきます。

エラーメッセージの確認

linker command failed with exit code 1 (use -v to see invocation)
のメッセージの上にこのようなファイルパスがあると思います。
Ld /Users/(ユーザー名)/Library/Developer/Xcode/DerivedData/(Xcode のプロジェクト名)/Build/Products/…(略

Finder で開く

とりあえず、このファイルパスを Finder で開きます。
Products ディレクトリの中には、最低2つ、ディレクトリがあると思います。
一つはDebug-iphoneosで、
もう一つはDebug-iphoneosですね。

存在しないファイルをコピー

この2つを比べてみると、
実機デバッグ可能で、シミュレータデバッグ不可能の場合、
Debug-iphoneosにあってDebug-iphoneosに存在しないファイルがあると思います。
とりあえず、存在しないファイルのみをコピーしましょう。

Xcode に戻ってデバッグ

どうでしょうか。シミュレータでもデバッグ可能になったと思います。

スクリーンショットは都合上、掲載していません。
わからないことがあればコメントなどでどうぞ。

9
10
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
9
10