0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

xcrun simctlで簡単!iOSシミュレータへの動画追加方法

Posted at

iOSシミュレータで動画関連のテストをする際、初期状態ではシミュレータ上に動画は入っていません。先日この問題に直面したので、シミュレータに簡単に動画を追加する方法を調べました。同じ状況の方の参考になれば幸いです。

コマンドラインを使う

個人的にはこの方法がおすすめです。ターミナルを開いて以下のコマンドを実行するだけ。

xcrun simctl addmedia booted .../.../sample.mp4

bootedは「今起動しているシミュレータ」という意味です。パスは自分の動画ファイルの場所に合わせて変更してください。

特定のデバイスに追加したい場合

複数のシミュレータを使い分けている場合は、デバイスIDを指定することもできます。

まずデバイスIDを確認:

xcrun simctl list devices | grep Booted

そして指定して追加:

xcrun simctl addmedia {deviceId} .../.../sample.mp4

その他の方法

ドラッグ&ドロップ

MP4ファイルをシミュレータのウィンドウにドラッグ&ドロップするだけでも追加できます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?