Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOSシミュレータの録画が面倒だったのでどうにかしてみた

7f2e0d6b54e2bd2a6527b9d468b1c4f6?s=47 huin
January 10, 2018

 iOSシミュレータの録画が面倒だったのでどうにかしてみた

2018/01/10にSmartNewsさんで行われた「「iOS 11 Programming」刊行記念 Night」(https://peaks.connpass.com/event/74553/) で発表したスライドです。

7f2e0d6b54e2bd2a6527b9d468b1c4f6?s=128

huin

January 10, 2018
Tweet

Transcript

  1. γϛϡϨʔλͷ࿥ը͕ ໘౗ͳͷͰͲ͏ʹ͔ͯ͠Έͨ

  2. 2 ! Koichi Sakata " @huin # huinme $ Fablic,

    Inc. ࣗݾ঺հ
  3. 3 What’s New in Xcode

  4. 4 What’s New in Xcode You can take a screenshot

    or a video recording of the simulator using the xcrun command-line utility.
  5. 5 γϛϡϨʔλʔͷ࿥ըػೳ > xcrun simctl io {device} recordVideo {filepath}

  6. 6 γϛϡϨʔλʔͷ࿥ըػೳ # 起動中のシミュレータを録画する > xcrun simctl io booted recordVideo

    ~/movie.mp4
  7. 7 ͱ͜ΖͰ

  8. 8 Xcode 9 ͷ৽ػೳͱ͍͑͹ γϛϡϨʔλͷෳ਺࣮ߦαϙʔτ

  9. 9 ෳ਺ىಈ͍ͯ͠Δঢ়ଶͩͱ Կ͕બ͹ΕΔͷ͔ʁ

  10. 10 …ਖ਼௚ྑ͘෼͔Γ·ͤΜͰͨ͠

  11. 11 ؾΛऔΓ௚ͯ͠ɺ

  12. 12 γϛϡϨʔλͷ࿥ըػೳ > xcrun simctl io {device} recordVideo {filepath}

  13. 13 γϛϡϨʔλʔͷ࿥ըػೳ # UDIDを指定すれば特定のシミュレータを録画できる > xcrun simctl io {UDID} recordVideo

    {filepath}
  14. 14 ͡Ό͋ɺγϛϡϨʔλͷUDID͸ʁ

  15. 15 γϛϡϨʔλҰཡͷදࣔ > xcrun simctl list
 
 == Device Types

    == == Runtimes == == Devices == -- iOS 10.3 — -- iOS 11.2 — iPhone X (2638D67D-7C6C-4BE7-893C-9A11DB294314) (Booted) iPhone 8 (D1152492-CA99-46FF-A828-9E7CD1E9B0FC) (Shutdown)
  16. 16 ࣮ࡍͷදࣔ

  17. 17 ຖճνΣοΫͯ͠ΒΕͳ͍…

  18. 18 • ෳ਺ىಈ͍ͯ͠Δঢ়ଶͰ΋؆୯ʹ࿥ը͍ͨ͠ • UDIDͷ֬ೝͱ࿥ըͰ2ճ΋ίϚϯυଧͪͨ͘ͳ͍

  19. 19 ͯ͜ͱͰ࡞ͬͯΈ·ͨ͠

  20. 20 ͱΓ͋͑ͣσϞ

  21. 21

  22. 22 How to Implementʁ

  23. 23 JSONͰදࣔͯ͠ύʔε͢Ε͹ىಈதͷσόΠεΛऔΓग़ͤΔʂ > xcrun simctl list —json { “devicetypes”: [

    … ], “runtimes”: [ … ], “devices”: { “iOS 11.2”: [ { “state”: “Booted”, “availability”: “(available)”, “name”: “iPhone X”, “udid”: “F421F28A-D26D-47D0-…”, } ] } }
  24. 24 ىಈதͷσόΠεΛϦετͯ͠ɺ ࿥ը͢ΔσόΠεΛબΜͰ΋Βͬͯɺ ࿥ըΛ࣮ߦ͢ΔϥούʔίϚϯυΛ࡞Ε͹ ͍͚Δ͸ͣʂ

  25. 25 Swift Package Manager ͷར༻ > mkdir simio && cd

    simio > swift package init —type executable > > swift package generate-xcodeproj
  26. 26

  27. 27

  28. 28 ࢖͍͍ͨͰ͔͢ʁ

  29. 29 ؾ͕޲͍ͨΒެ։͠·͢

  30. 30 Thank you!!