LoginSignup
19
19

More than 5 years have passed since last update.

iOS端末のスクリーンショットをコマンドラインから取得する方法

Last updated at Posted at 2014-03-24

libimobiledevice (github) を使うことにより、アプリケーション側の改変なしにスクリーンショットの取得が可能。

libimobiledeviceバイナリ(群)の取得

$ git clone GIT-URL /your/path/here

bash_profileを編集

bash_profileを編集し、ダイナミックリンクライブラリが落としてきたやつを優先的に参照するように変更する。以下の2行を追加。

~/.bash_profile
export DYLD_LIBRARY_PATH=/your/path/here/imobiledevice-macosx/:$DYLD_LIBRARY_PATH
PATH=${PATH}:/your/path/here/imobiledevice-macosx/

編集した後は有効にするのを忘れずに

source ~/.bash_profile

準備

XCode立ち上げ、iOS端末をMacに接続しておく必要があるようです。
iOS端末にロックがかかっている場合はロックを解除しないとデバイスが見つからない状態になるようです。

デバイスIDのリストアップ

以下のコマンドでUUIDのリストアップができる。

idevice_id -l

スクリーンショットの取得

idevicescreenshot

カレントディレクトリにTIFFフォーマットでスクリーンショットでファイルが取得できる。
複数台つないでいる場合は -u {UUID}オプションによりで端末を指定できるみたい。

参考

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