Xcode6のiPhone Simulatorの場所が変わったのでどの端末か見やすくなるようにしてみた。

  • 9
    Like
  • 0
    Comment
More than 1 year has passed since last update.

Xcode6でiPhone Simulatorの場所が変更になってました。
~/Developer/CoreSimulator/Devices/[DeviceID]/data/Containers/Data/Application/[App]
前までSimulatorのOSバージョンのディレクトリがあって辿りやすかったんですがDeviceIDになってちょっと分かりづらくなってるみたい。
DeviceID配下にdevice.plistがあってその中の情報を見ればその端末の名前(iPhone5とかiPhone6とか)とバージョンがわかりそう。

なのでどのディレクトリがどの端末か分かるようにシェル書いてみた。
https://github.com/tamaki-shingo/iOSSimList

実行結果


$ [DeviceID] - iPhone 5s(iOS.8.0)
$ [DeviceID] - iPhone 5s(iOS.8.0)
$ [DeviceID] - iPad 2(iOS.7.1)
$ [DeviceID] - iPhone 6 Plus(iOS.8.0)
$ [DeviceID] - iPhone 5(iOS.7.1)
  以下略

OSバージョン毎のソートとか、端末名のソートとかは後で考えて気が向けば対応しよう。

追記

今更ながらxcrunでイけるとわかった、こっちの方がRuntimeも表示されるしApple公式なので
今後はこっちを使おうと思います。

xcrun simctl list

実行結果


== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
== Runtimes ==
iOS 7.1 (7.1 - 11D167) (com.apple.CoreSimulator.SimRuntime.iOS-7-1) (unavailable, failed to open liblaunch_sim.dylib)
iOS 8.1 (8.1 - 12B411) (com.apple.CoreSimulator.SimRuntime.iOS-8-1) (unavailable, failed to open liblaunch_sim.dylib)
iOS 8.2 (8.2 - 12D508) (com.apple.CoreSimulator.SimRuntime.iOS-8-2) (unavailable, failed to open liblaunch_sim.dylib)
iOS 9.0 (9.0 - 13A340) (com.apple.CoreSimulator.SimRuntime.iOS-9-0)
watchOS 2.0 (2.0 - 13S343) (com.apple.CoreSimulator.SimRuntime.watchOS-2-0)
== Devices ==
-- iOS 7.1 --
    iPhone 4s (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
    iPhone 5 (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
    iPhone 5s (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
    iPad 2 (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
    iPad Retina (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
    iPad Air (DeviceID) (Shutdown) (unavailable, failed to open liblaunch_sim.dylib)
-- iOS 8.1 --
(以下略)