「IOS」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎iPhone/iPod Touch: 英語版に差し替え)
 
(同じ利用者による、間の4版が非表示)
1行目: 1行目:
 
{{Lowercase title}}
 
{{Lowercase title}}
 
[[Category:IOS]]
 
[[Category:IOS]]
[[en:iPod]]
+
[[en:iOS]]
[[fr:iPod]]
 
[[zh-hans:IPod]]
 
 
{{Related articles start}}
 
{{Related articles start}}
 
{{Related|オーディオブック}}
 
{{Related|オーディオブック}}
 
{{Related|iPhone テザリング}}
 
{{Related|iPhone テザリング}}
  +
{{Related|iPod}}
 
{{Related articles end}}
 
{{Related articles end}}
この記事では Arch Linux で '''iPad''', '''iPod''', '''iPhone''' を使用する方法を説明します。
 
   
  +
[https://www.apple.com/ios/ iOS] は、Apple Inc.が開発した iPhone シリーズのスマートフォン向け OS です。 iOS デバイスを Linux に接続することは Apple によってサポートされていませんが、[https://libimobiledevice.org/ libimobiledevice] プロジェクトは、iOS デバイスと Linux マシン間で接続してデータを転送するためのライブラリとツールを提供します。
== デバイスに接続する ==
 
[[GVFS]] を使用するアプリケーション、ファイルマネージャ ([[GNOME Files]] や [[Thunar]]) あるいはメディアプレイヤー ([[Rhythmbox]]) は {{pkg|gvfs-afc}} パッケージを[[インストール]]することで iOS デバイスを扱えるようになります。パッケージをインストールしたらファイルマネージャやアプリケーションを再起動する必要があります。また、ファイルマネージャやアプリケーションからデバイスが認識されない場合はバックグラウンドで usbmuxd が動作しているか確認してください。
 
   
  +
{{Tip|[[KDE#KDE Con​​nect]] は、iOS と Linux 間のファイル転送にも使用できます。}}
== iPod のマウントポイントの変更 ==
 
   
  +
== インストール ==
伝統的に iPod は vfat ファイルシステム (稀に {{ic|hfsplus}}) が入っている普通の USB ストレージデバイスと[[USB ストレージデバイス|同じようにアクセス]]することができます。詳しい説明は[[USB ストレージデバイス]]の記事を見て下さい。
 
   
  +
{{Pkg|libimobiledevice}} パッケージを[[インストール]]します。
udisks2 が動作している場合、接続された iPod は {{ic|/run/media/''$USER''/''iPod_name''}} にマウントされます。
 
   
  +
== デバイスへの接続 ==
iPod のボリュームラベルが長くて、空白や大文字・小文字が混じっていると、不便なことがあります。{{pkg|dosfstools}} パッケージの {{ic|dosfslabel}} を使うことでボリュームを簡単に好都合なように変更することが可能です:
 
   
  +
=== Usbmux デーモン ===
* 現在のボリュームラベルを取得・確認:
 
# dosfslabel /dev/sd''XY''
 
* 新しいボリュームラベルを設定:
 
# dosfslabel /dev/sd''XY'' ArchPod
 
* デバイスをアンマウント:
 
$ udisksctl unmount -b /dev/sd''XY''
 
* もう一度マウントしなおす:
 
$ udisksctl mount -b /dev/sd''XY''
 
{{ic|/dev/sdxx}} は iPod の現在のデバイスノードに置き換えてください。
 
   
  +
''libimobiledevice'' パッケージは {{pkg|usbmuxd}} に依存しており、iOS デバイスへの低レベル接続を実行します。''usbmuxd'' パッケージには、デバイスが接続または切断されるたびにデーモンを自動的に開始および停止する [[udev]] ルールも含まれています。
== 動画や写真のインポート ==
 
   
  +
iOS デバイスを接続し、{{ic|usbmuxd.service}} が自動的に開始されることを確認します。
通常は {{ic|''<mountpoint>''/DCIM/100APPLE}} で動画と写真の両方が見つかります。
 
   
  +
{{hc|$ systemctl status usbmuxd.service|
=== HTML5 動画 ===
 
  +
''...''
  +
Active: active (running) since Sun 2020-01-19 19:23:18 UTC; 22s ago
  +
''...''
  +
}}
   
  +
===ペアリング===
{{Pkg|ffmpeg2theora}} を使って MOV ファイルを OGV などの HTML5 動画フォーマットに変換したいということもあるでしょう。作成日のメタデータは変換された動画に含まれないので、以下のようなスクリプトを使う必要があります:
 
   
  +
iOS デバイスを接続して画面のロックを解除すると、デバイス上のポップアップで「このコンピューターを信頼しますか?」というメッセージが表示されます。 [信頼する] をタップし、デバイスのパスコードを入力してペアリングプロセスを完了します。
{{bc|<nowiki>
 
#!/usr/bin/sh
 
   
  +
ポップアップが表示されない場合は、ペアリングプロセスを手動で開始できます。デバイスを接続し、画面のロックを解除して実行します。
find -name "*.MOV" | while read mov
 
do
 
d=$(gst-discoverer-1.0 -v $mov | awk '/datetime:/{print $2}' | tr -d \")
 
base=${mov%.*}
 
if test -f $base.ogv
 
then
 
touch -d${d} $base.ogv
 
ls -l $base.ogv
 
else
 
echo $base.ogv missing
 
fi
 
done
 
</nowiki>}}
 
   
  +
{{hc|$ idevicepair pair|
ファイルの日付と時刻が変わらないように {{ic|cp -a}} あるいは {{ic|rsync -t}} を使ってください。
 
  +
SUCCESS: Paired with device d8e8fca2dc0f896fd7cb4cb0031ba249
  +
}}
   
  +
複数の iOS デバイスが接続されている場合、{{ic|--udid ''ios_udid''}} パラメータをターゲットの特定のデバイスに渡すことができます。
=== 写真をインポートして削除する ===
 
   
  +
次のコマンドを実行して、ペアリングが成功したことを確認できます。
{{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}} から写真や動画を移動することはできますが、古いデータベースを削除して "Camera Roll" データベースを再作成させる必要があります。
 
   
  +
{{hc|$ idevicepair validate|
# rm Photos* com.apple.photos.caches_metadata.plist
 
  +
SUCCESS: Validated pairing with device 00008030-001D3562367A402E
  +
}}
   
  +
=== データ転送 ===
== iOS 用に動画を変換 ==
 
   
  +
ペアリング後、iOS は 2 つの異なるファイルシステムをコンピューターに公開します。 1 つは、デバイスの写真、ビデオ、および音楽を含むメディア ファイル システムです。 2 番目のファイルシステムは、ファイルを特定のアプリと直接共有するために使用されます。これは「iTunes ドキュメント共有」と呼ばれることもあります。 [https://support.apple.com/en-us/HT201301] [https://www.hadess.net/2010/12/house-arrest-or-just-document-sharing.html]
=== Handbrake ===
 
   
  +
==== グラフィカルファイルマネージャーの使用 ====
[http://handbrake.fr/ Handbrake] は様々なバージョンの iPod 用のプリセットが入っている気の利いたツールです。CLI と GTK 版がそれぞれ {{pkg|handbrake-cli}} と {{pkg|handbrake}} パッケージでインストールできます。
 
   
  +
[[GVFS]] を使用するファイル マネージャーは、iOS デバイスとやり取りできます。メディアファイルシステムにアクセスするには、{{Pkg|gvfs-gphoto2}}を[[インストール]]します。アプリ文書ファイルシステムにアクセスするには、{{Pkg|gvfs-afc}} をインストールします。
CLI で使うときは、http://trac.handbrake.fr/wiki/CLIGuide にガイドがあります。
 
   
  +
{{Note|メディアファイルシステムにアクセスする場合、GVFS はデバイスの写真とビデオのみを公開し、音楽は公開しません。}}
=== Avidemux ===
 
{{Pkg|avidemux-qt}} パッケージをインストールしてください。
 
   
  +
[[Dolphin]] を使用して iOS ファイルにアクセスするには、{{AUR|solid-git}} と {{AUR|kio-extras-git}} をインストールします。これにより、メディアとアプリ ドキュメントの両方のファイル システムが公開されます。 [https://blog.broulik.de/2022/11/introducing-kio-afc/]
Avidemux は mp4 ファイルに変換することができます。最大ビットレート @ 700 で動画サイズを 720x480 または 320x240 にすることで上手く動画ファイルを抽出できます。
 
   
=== Mencoder ===
+
==== 手動でマウント ====
   
{{pkg|mplayer}} パッケージを[[インストール]]してください
+
{{Pkg|ifuse}} パッケージを[[インストール]]します。次に、以下のコマンドを実行して、iPhone のメディアファイルシステムをマウントします
   
  +
$ ifuse ''mountpoint''
Mencoder の設定は色々あり、iPod で再生できる動画ファイルを作り上げることができます。{{man|1|mencoder}} を参照してください。MPlayer のオプションがエンコーディングにも影響します。
 
   
  +
これを使用して、{{ic|''mountpoint''/DCIM}} 内のデバイスの写真にアクセスできます。
基本的なガイドは [[MEncoder]] を見てください。
 
   
  +
{{Note|デバイスの音楽データベースは、{{ic|''mountpoint''/iTunes_Control}} でもアクセスできます。この方法でデバイスに新しい曲を追加することはできませんが、デバイスからコンピュータに曲をコピーすることはできます。}}
iPhone/iPod Touch に対応する動画をエンコードするコマンドの例:
 
   
  +
{{Template:Warning|iTunes_Control 内のデータベースを手動で編集すると、データベースが破損し、同期された曲がシステムの復元によってのみ削除できる古いデータになります。}}
$ mencoder INPUT -o output.mp4 \
 
-vf scale=480:-10,harddup \
 
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \
 
-of lavf -lavfopts format=mp4 \
 
-ovc x264 -x264encopts nocabac:level_idc=30:bframes=0
 
   
  +
アプリの文書ファイルシステムにアクセスするには、まずアプリを識別する必要があります。
=== FFmpeg ===
 
   
  +
{{hc|$ ifuse --list-apps|
{{pkg|ffmpeg}} パッケージを[[インストール]]してください。
 
  +
"CFBundleIdentifier","CFBundleVersion","CFBundleDisplayName"
  +
"org.videolan.vlc-ios","432","VLC"
  +
"org.wikimedia.wikipedia","1932","Wikipedia"
  +
"org.kde.kdeconnect","2","KDE Connect"
  +
[...]
  +
}}
   
  +
その後、以下を使用してアプリケーションのファイルをマウントできます。
様々な設定をサポートしているエンコーダーです。第5世代 iPod 用にエンコードするコマンドの例:
 
   
  +
$ ifuse --documents ''APPID'' ''mountpoint''
$ ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 \
 
-g 300 -acodec aac -ab 96 -i INPUT -s 320x240 \
 
-aspect 4:3 output.mp4
 
   
  +
''APPID'' は {{ic|org.videolan.vlc-ios}} などの目的のアプリケーションのバンドル ID です。
iPod Touch/iPhone 対応の動画を出力する例:
 
   
  +
完了したら、ファイルシステムをアンマウントします。
$ ffmpeg -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5\
 
-bufsize 4096 -g 300 -acodec aac -ab 192 -s 480×320 -aspect 4:3 -i INPUT output.mp4
 
   
  +
$ fusermount -u ''mountpoint''
== Device specific ==
 
   
  +
== Importing videos and pictures ==
=== iPhone/iPod Touch ===
 
   
  +
Both videos and photos can be found in typically in {{ic|''&lt;mountpoint&gt;''/DCIM/100APPLE}}.
==== Generating HashInfo file ====
 
   
  +
=== HTML5 videos ===
If you have never synced your device using ''iTunes'', you will get error messages telling you that the HashInfo file is missing. This can be fixed by syncing once with iTunes in order to create it.
 
Alternatively one can create this file using the site http://ihash.marcansoft.com/. Enter the serial number of the iPod on the website. It will generate a file named {{ic|HashInfo}} which you will place under the {{ic|/mnt/ipod/iPod_Control/Device/}} directory. Unplug the iPod device and plug it back.
 
   
  +
Typically you want to convert MOV files to a HTML5 video format like OGV using {{Pkg|ffmpeg2theora}}. Note that the creation date metadata is not in the converted video, so you need to use a script like:
==== Unobfuscating the Database ====
 
   
  +
{{bc|1=
{{Out of date|iOS version 2.0 is from 2008, and libgpod is already able to read the database without jailbreaking the device and editing system files.}}
 
  +
#!/usr/bin/sh
   
  +
find -name "*.MOV" {{!}} while read mov
Since firmware version 2.0, Apple has obfuscated the music database. If you are using recent firmware, the file {{ic|/System/Library/Lockdown/Checkpoint.xml}} can be modified to enable use of the older, non-obfuscated database. If that file does not exist then try to copy from {{ic| /System/Library/CoreServices/Checkpoint.xml}} to {{ic|/System/Library/Lockdown/Checkpoint.xml}} then replace:
 
  +
do
<key>DBVersion</key>
 
  +
d=$(gst-discoverer-1.0 -v $mov {{!}} awk '/datetime:/{print $2}' {{!}} tr -d \")
<integer>4</integer>
 
  +
base=${mov%.*}
with:
 
  +
if test -f $base.ogv
<key>DBVersion</key>
 
  +
then
<integer>2</integer>
 
  +
touch -d${d} $base.ogv
Then reboot your device.
 
  +
ls -l $base.ogv
 
  +
else
If syncing fails with "ERROR: Unsupported checksum type '0' in cbk file generation!", you may need to leave this at 4. libgpod seems to [http://gitorious.org/libgpod/libgpod/blobs/b9b83dc8b6c3d1f0c53ed32f05279ca838d54e02/src/itdb_sqlite.c#line2064 expect a hashed database.]{{Dead link|2022|09|18|status=SSL error}}
 
  +
echo $base.ogv missing
 
  +
fi
=== iPod Classic/Nano (3rd generation) ===
 
  +
done
 
  +
}}
You need to set up the iPod to make libgpod able to find its Firewire ID. For this, you will need to get your FireWire ID manually
 
 
1) Mount the iPod as a rw mount point. In the following example, use {{ic|/mnt/ipod}}.
 
 
2 ) Find the serial number by typing
 
 
# lsusb -v | grep -i Serial
 
 
this should print a 16 character long string like 00A1234567891231 (it will have no colons or hyphens)
 
 
3) Once you have that number, create or edit {{ic|/mnt/ipod/iPod_Control/Device/SysInfo}}. Add to that file the line below:
 
 
FirewireGuid: 0xffffffffffffffff
 
 
(replace ffffffffffffffff with the 16 digit string you obtained at the previous step and do not forget the leading 0x before the string)
 
 
Your iPod can now be managed with Amarok or gtkpod.
 
 
=== iPod Nano 5th generation ===
 
 
Follow the instructions above [[#Generating HashInfo file]] in order to set up the hash file, it is needed to write into the device music library.
 
To be able to use the iPod Nano 5th gen with {{pkg|libgpod}}, a {{ic|SysInfoExtended}} file is also needed to be placed in the directory {{ic|/mnt/ipod/iPod_Control/Device/}}. It can be generated using:
 
 
# ipod-read-sysinfo-extended ''bus'' ''device'' ''mountpoint''
 
 
for example:
 
 
# ipod-read-sysinfo-extended 001 011 /mnt/ipod/
 
 
=== iPod Nano 6th generation ===
 
 
By default libgpod does not seem to be able to synchronize on a iPod Nano 6th generation. It copies data, but as soon as USB is disconnected, everything is as before. The package {{AUR|libhashab-git}} fixes this.
 
Additionally, the {{ic|SysInfoExtended}} file is also required, and can be generated in the same fashion as in [[#iPod Nano 5th generation]], however a {{ic|HashInfo}} file is unnecessary on this model.
 
 
=== iPod Shuffle 1st and 2nd generation ===
 
 
[http://shuffle-db.sourceforge.net/ rebuild_db] is a Python 2 script that makes it possible to use the iPod Shuffle almost like any other USB flash MP3 player. Download the script from the website, then place it in the iPod's root directory. Copy your MP3 files onto the iPod Shuffle (sub-folders are allowed too) and then run the script:
 
 
$ python2 /mnt/iPod/rebuild_db.py
 
 
=== iPod Shuffle 4th generation ===
 
 
In order to use this version of the iPod Shuffle under linux, you can use the python based command line tool {{AUR|ipod-shuffle-4g}}. It also provides advanced voiceover and (auto)playlist generation support.
 
 
=== iPod Video (5th and 5.5th generation) ===
 
 
iPods in the mainline series up to and including this model do not support the AAC PNS feature, and will display audible artifacts when encountering it. Disable the feature in {{Pkg|ffmpeg}} when encoding AAC files for these devices.
 
 
$ ffmpeg -i input.ogg -c:a aac -b:a 256k -aac_pns 0 -movflags +faststart -vn output.m4a
 
 
The {{ic|-movflags +faststart}} options place the moov atom at the start of the file, which helps the iPod parse the file faster.
 
 
== iPod Classic/Nano (第3世代) ==
 
 
iPod を設定して FireWire ID を libgpod から探知できるようにする必要があります。手動で FireWire ID を取得してください。
 
 
* 読み書き可能なマウントポイントとして iPod をマウントしてください。以下の例では {{ic|/mnt/ipod}} を使います。
 
 
* 以下のコマンドを実行してシリアル番号を確認してください:
 
 
# lsusb -v | grep -i Serial
 
 
上記のコマンドで {{ic|00A1234567891231}} のような16文字の文字列が出力されます (コロンやハイフンは含まれません)。
 
 
* 番号をメモしたら {{ic|/mnt/ipod/iPod_Control/Device/SysInfo}} を作成・編集してください。ファイルに以下の行を追加します (ffffffffffffffff はメモした16桁の文字列に置き換えてください、最初の 0x は消してはいけません):
 
 
FirewireGuid: 0xffffffffffffffff
 
 
これで [[Amarok]] や gtkpod で iPod が管理できるようになります。
 
 
== 第1・2世代 iPod Shuffle ==
 
 
("巨大な" iPod に比べて) Shuffle の構造は単純なため、他の USB フラッシュ MP3 プレイヤーと同じように扱うことができます。iPod のルートディレクトリには [https://sourceforge.net/projects/shuffle-db/files/latest/download rebuild_db.py] ファイルを保存する必要があります。MP3 ファイルを iPod Shuffle にコピーしたら (サブフォルダも使えます)、以下のコマンドを実行してください [http://shuffle-db.sourceforge.net/]:
 
 
$ python2 /path/to/rebuild_db.py
 
 
== 第4世代 iPod Shuffle ==
 
Linux で iPod Shuffle の第4世代を使うには Python ベースのコマンドラインツールである {{AUR|ipod-shuffle-4g}} を使用します。高度なボイスオーバーやプレイリストの(自動)作成なども対応しています。
 
   
  +
And use {{ic|cp -a}} or {{ic|rsync -t}} in order to preserve the file's date & time.
== iPod 管理アプリ ==
 
*[[Rhythmbox]]
 
**GTK インターフェイス ([[GNOME]])。
 
**公式の GNOME プロジェクトに入っています。
 
**高速で軽量なインターフェイス。
 
**コンピュータと iPod の音楽を管理。
 
**ポッドキャストやビデオキャプチャのダウンロードやストリーミング。
 
**曲やポッドキャストの再生待ち。
 
**Last.fm の統合。
 
**インターネットラジオの視聴。
 
**Jamendo と Magnatune のサポート。
 
**音楽 CD の書き込み。
 
**アルバムカバーの表示。
 
**歌詞の表示。
 
**DAAP 共有。
 
   
  +
== Troubleshooting ==
*[http://banshee.fm Banshee]
 
**GTK インターフェイス (GNOME)。
 
**Mono を使っているため、やや重く、rhythmbox よりもリソースを消費します。
 
**デバイスの同期: 音楽や動画を Android, iPod などに同期、あるいはメディアをインポート。
 
**ポッドキャスト: ポッドキャストやビデオキャストをダウンロード・ストリーミング。
 
**プレイキュー: 曲や動画、ポッドキャストを再生待ちに追加して自動で DJ。
 
**シャッフルモード: アーティストやアルバム、レーティング、あるいは曲の雰囲気などでシャッフル (あるいは Auto DJ)。
 
**アルバムアート: 自動的にアートワークを取得。
 
**強力な検索機能、スマートプレイリスト: 聞きたい曲をすぐに・正確に検索。
 
**動画のサポート: Banshee の機能は全て動画でも活用できる。
 
   
  +
=== ifuse fails to mount application directories ===
*[http://www.yamipod.com Yamipod]
 
**GTK インターフェイス (GNOME)。
 
**iPod の音楽を管理するだけの超軽量なアプリケーション (コンピュータの音楽は管理できない)。
 
**簡単なレーティングの編集。
 
**PC から iPod に同期。
 
**ニュース RSS やポッドキャストを iPod にアップロード。
 
**Last.fm サポート。
 
**playlist サポート。
 
   
  +
When using ''ifuse'' to mount application directories, you may run into the following error when trying to list the contents of the mountpoint:
*[http://www.gtkpod.org gtkpod]
 
**GTK インターフェイス (GNOME)
 
**既存の iTunesDB を読み込む (iPod の再生回数や評価、On-The-Go プレイリストなどをインポート)。
 
**MP3, WAV, M4A (保護されてない AAC), M4B (オーディオブック), ポッドキャスト, 動画ファイル (単体ファイル, ディレクトリ, プレイリスト) を iPod に追加。'bashpodder' や 'gpodder' などのポッドキャストをダウンロードするにはサードパーティの製品が必要です。
 
**カバーアートの表示・追加・修正。
 
**ローカルデータベースに曲を全て追加して、アルバムやアーティスト、あるいはジャンルでハードディスクの中身を閲覧。トラックは iPod/Shuffle に簡単にドラッグできます。
 
**プレイリストの作成・修正、スマートプレイリスト。
 
**ID3 タグのエンコーディング文字セットを選択できます。デフォルトではロケールの設定が使われます。
 
**テンプレートを指定することでファイル名からタグ情報を取得 (アーティスト, アルバム, 曲名...)。
 
**曲を追加する際に重複を検出 (任意)。
 
**iPod からトラックを削除・エクスポート。
 
**ID3 タグの修正 -- 元のファイルでも変更されます (任意)。
 
**ファイルの ID3 タグを戻す (元のファイルのタグを変更した場合)。
 
**ディレクトリの同期。
 
**トラックの音量のノーマライゼーション (mp3gain や replay-gain タグを使用)。
 
**iTunesDB を更新して iPod に追加した曲を書き出す。
 
**オフラインでも動作し後から iPod とプレイリストや曲を同期できます。
 
**korganizer/kaddressbook/Thunderbird/evocalendar/evolution/webcalendar... などのデータを iPod にエクスポート (他のプログラムのスクリプトを追加できます)。
 
   
  +
".": Input/output error (os error 5)
*[http://www.floola.com Floola]
 
**GTK インターフェイス (GNOME)。
 
   
  +
This is a [https://github.com/libimobiledevice/ifuse/issues/63 known issue] that has been fixed in the current development version of libimobiledevice, but has not been released in a stable version yet. A workaround is to install {{Aur|libimobiledevice-git}}.
*[http://amarok.kde.org/ Amarok]
 
**KDE/qt インターフェイス。
 
   
  +
=== Device cannot be redirected to a virtual machine ===
*[http://qpod.sourceforge.net qPod]
 
**KDE/qt インターフェイス。
 
**GNUpod のフロントエンド。
 
   
  +
If you use a Windows virtual machine to sync your device via USB, trying to redirect it may fail with a "device is in use by another application" message. This is due to {{ic|usbmuxd.service}} starting automatically when the device is connected. This can be solved by either [[systemd#Using units|stopping or masking]] {{ic|usbmuxd.service}}.
*[https://www.gnu.org/software/gnupod/ GNUpod]
 
**コマンドラインのみ。
 
   
  +
== See also ==
*[http://www.jakpod.de/ jakpod]
 
** JakPod は Java で書かれており、音楽や動画ファイルを iPod にコピーすることができます。
 
** 第6世代 iPod Nano サポート。
 
** {{AUR|jakpod}}{{Broken package link|パッケージが存在しません}}
 
   
  +
* [https://help.ubuntu.com/community/PortableDevices/iPhone Ubuntu documentation for iPhone and iPod Touch] (not updated since 2014)
== 参照 ==
 
  +
* [http://wiki.gotux.net/code/perl/atget Apple trailers downloader script]{{Dead link|2020|03|29|status=domain name not resolved}}
* [http://help.ubuntu.com/community/PortableDevices/iPhone iPhone/iPod Touch のサポートに関する詳細情報]
 
* [http://wiki.gotux.net/code/perl/atget Apple トレイラーのダウンロードスクリプト]
 

2022年12月17日 (土) 09:04時点における最新版

関連記事

iOS は、Apple Inc.が開発した iPhone シリーズのスマートフォン向け OS です。 iOS デバイスを Linux に接続することは Apple によってサポートされていませんが、libimobiledevice プロジェクトは、iOS デバイスと Linux マシン間で接続してデータを転送するためのライブラリとツールを提供します。

ヒント: KDE#KDE Con​​nect は、iOS と Linux 間のファイル転送にも使用できます。

インストール

libimobiledevice パッケージをインストールします。

デバイスへの接続

Usbmux デーモン

libimobiledevice パッケージは usbmuxd に依存しており、iOS デバイスへの低レベル接続を実行します。usbmuxd パッケージには、デバイスが接続または切断されるたびにデーモンを自動的に開始および停止する udev ルールも含まれています。

iOS デバイスを接続し、usbmuxd.service が自動的に開始されることを確認します。

$ systemctl status usbmuxd.service
...
Active: active (running) since Sun 2020-01-19 19:23:18 UTC; 22s ago
...

ペアリング

iOS デバイスを接続して画面のロックを解除すると、デバイス上のポップアップで「このコンピューターを信頼しますか?」というメッセージが表示されます。 [信頼する] をタップし、デバイスのパスコードを入力してペアリングプロセスを完了します。

ポップアップが表示されない場合は、ペアリングプロセスを手動で開始できます。デバイスを接続し、画面のロックを解除して実行します。

$ idevicepair pair
SUCCESS: Paired with device d8e8fca2dc0f896fd7cb4cb0031ba249

複数の iOS デバイスが接続されている場合、--udid ios_udid パラメータをターゲットの特定のデバイスに渡すことができます。

次のコマンドを実行して、ペアリングが成功したことを確認できます。

$ idevicepair validate
SUCCESS: Validated pairing with device 00008030-001D3562367A402E

データ転送

ペアリング後、iOS は 2 つの異なるファイルシステムをコンピューターに公開します。 1 つは、デバイスの写真、ビデオ、および音楽を含むメディア ファイル システムです。 2 番目のファイルシステムは、ファイルを特定のアプリと直接共有するために使用されます。これは「iTunes ドキュメント共有」と呼ばれることもあります。 [1] [2]

グラフィカルファイルマネージャーの使用

GVFS を使用するファイル マネージャーは、iOS デバイスとやり取りできます。メディアファイルシステムにアクセスするには、gvfs-gphoto2インストールします。アプリ文書ファイルシステムにアクセスするには、gvfs-afc をインストールします。

ノート: メディアファイルシステムにアクセスする場合、GVFS はデバイスの写真とビデオのみを公開し、音楽は公開しません。

Dolphin を使用して iOS ファイルにアクセスするには、solid-gitAURkio-extras-gitAUR をインストールします。これにより、メディアとアプリ ドキュメントの両方のファイル システムが公開されます。 [3]

手動でマウント

ifuse パッケージをインストールします。次に、以下のコマンドを実行して、iPhone のメディアファイルシステムをマウントします。

$ ifuse mountpoint

これを使用して、mountpoint/DCIM 内のデバイスの写真にアクセスできます。

ノート: デバイスの音楽データベースは、mountpoint/iTunes_Control でもアクセスできます。この方法でデバイスに新しい曲を追加することはできませんが、デバイスからコンピュータに曲をコピーすることはできます。
警告: iTunes_Control 内のデータベースを手動で編集すると、データベースが破損し、同期された曲がシステムの復元によってのみ削除できる古いデータになります。

アプリの文書ファイルシステムにアクセスするには、まずアプリを識別する必要があります。

$ ifuse --list-apps
"CFBundleIdentifier","CFBundleVersion","CFBundleDisplayName"
"org.videolan.vlc-ios","432","VLC"
"org.wikimedia.wikipedia","1932","Wikipedia"
"org.kde.kdeconnect","2","KDE Connect"
[...]

その後、以下を使用してアプリケーションのファイルをマウントできます。

$ ifuse --documents APPID mountpoint

APPIDorg.videolan.vlc-ios などの目的のアプリケーションのバンドル ID です。

完了したら、ファイルシステムをアンマウントします。

$ fusermount -u mountpoint

Importing videos and pictures

Both videos and photos can be found in typically in <mountpoint>/DCIM/100APPLE.

HTML5 videos

Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora. Note that the creation date metadata is not in the converted video, so you need to use a script like:

#!/usr/bin/sh

find -name "*.MOV" | while read mov
do
    d=$(gst-discoverer-1.0 -v $mov | awk '/datetime:/{print $2}' | tr -d \")
    base=${mov%.*}
    if test -f $base.ogv
    then
        touch -d${d} $base.ogv
        ls -l $base.ogv
    else
        echo $base.ogv missing
    fi
done

And use cp -a or rsync -t in order to preserve the file's date & time.

Troubleshooting

ifuse fails to mount application directories

When using ifuse to mount application directories, you may run into the following error when trying to list the contents of the mountpoint:

".": Input/output error (os error 5)

This is a known issue that has been fixed in the current development version of libimobiledevice, but has not been released in a stable version yet. A workaround is to install libimobiledevice-gitAUR.

Device cannot be redirected to a virtual machine

If you use a Windows virtual machine to sync your device via USB, trying to redirect it may fail with a "device is in use by another application" message. This is due to usbmuxd.service starting automatically when the device is connected. This can be solved by either stopping or masking usbmuxd.service.

See also