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

既存アプリをXcode8対応させた話

28f57a43ae8eba102877b7a3d64f688a?s=47 Kohei Tabata
September 22, 2016

 既存アプリをXcode8対応させた話

28f57a43ae8eba102877b7a3d64f688a?s=128

Kohei Tabata

September 22, 2016
Tweet

Transcript

  1. طଘΞϓϦΛXcode8 ରԠͤͨ͞࿩ 2016/09/22 SwiftѪ޷ձ@G's ACADEMY

  2. ࣗݾ঺հ ɾKohei Tabata(@nerd0geek1) ɾSaib Studio LLC ɾiOS/MacOS/tvOS Developer ɾFastlaneେ޷͖ ɾSwiftѪ޷ձେ޷͖

    Said Studio LLC Kohei Tabata Next! Remote quick-zip plus Sleeple
  3. http://next.saib-stud.io

  4. Xcode8ग़·ͨ͠Ͷ

  5. ରԠऴΘΓ·ͨ͠ʁ

  6. Xcode8ରԠͯ͠ΈͨͷͰ ஌ݟΛڞ༗͠·͢ɻ

  7. ୊ࡐ ɾNext! Remote(iOSΞϓϦ)ɺNext! for Mac(MacΞϓϦ) ɾCocoaPodsɺCarthageΛར༻ͨ͠ϑϧSwiftΞϓϦ ɾ51ϑΝΠϧɺ2400ߦ(Next! RemoteɺclocͰܭଌ) ɾ21ϑΝΠϧɺ1200ߦ(Next! for

    MacɺclocͰܭଌ) ͱ͍ͬͨൺֱతখن໛ͳΞϓϦ
  8. ໨࣍ ɾSwift3΁ͷҠߦʹ௅ઓ ɾSwift2.3΁ͷҠߦʹ௅ઓ ɾͦͷଞ

  9. Swift3΁ͷҠߦʹ௅ઓ

  10. μϝͰͨ͠ ɾSwift3Ҡߦ͢ΔͨΊʹ͸ɺϥΠϒϥϦ౳͕શͯSwift3Ҡߦ͍ͯ͠Δ ɹඞཁ͋Γ ɾར༻͍ͯ͠ΔେखOSSͷ͏ͪɺQuick, Nimble͸ରԠࡁɻ ɹSnapKit͕ະରԠɻ ɾcarthage update —platform iOSͰίέͯ͠·͏ɻ

    ɾͱ͍͏Θ͚Ͱૣʑʹఫୀɻ
  11. Swift2.3΁ͷҠߦʹ௅ઓ

  12. େ͖ͳࠔ೉΋ͳ͘׬ྃ ɾCoreBluetooth.frameworkͰͪΐͬͱͭ·ͮ͘ ɹiOS9 ɿCBCentralManagerState ɹiOS10ɿCBManagerState ɹˢޓ׵ੑͳ͠ ɾͦΕҎ֎͸ɺ override func touchesCancelled(touches:

    Set<UITouch>?, withEvent event: UIEvent?) ͱ override func touchesCancelled(touches: Set<UITouch>, withEvent event: UIEvent?) ͘Β͍
  13. ऴΘΓͩͱࢥͬͨʁ

  14. None
  15. ࣗݾ঺հ ɾKohei Tabata(@nerd0geek1) ɾSaib Studio LLC ɾiOS/MacOS/tvOS Developer ɾFastlaneେ޷͖ ɾAKIBA.swiftେ޷͖

    Said Studio LLC Kohei Tabata Next! Remote quick-zip plus Sleeple
  16. ͓෼͔Γ௖͚ͨͩΖ͏͔…

  17. None
  18. Ͳ͏࢖͍͔ͬͯͨʁ CircleCI্Ͱ ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠ ɾscanͰςετ ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠ ɾgymͰipaϑΝΠϧΛ࡞੒ ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

  19. Xcode8ʹ͢Δͱ CircleCI্Ͱ ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠ ɾscanͰςετ ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠ ɾgymͰipaϑΝΠϧΛ࡞੒ ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

  20. Xcode8ʹ͢Δͱ CircleCI্Ͱ ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠ ɾscanͰςετ ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠ ɾgymͰipaϑΝΠϧΛ࡞੒ ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

  21. Xcode8ʹ͢Δͱ CircleCI্Ͱ ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠ ɾscanͰςετ ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠ ɾgymͰipaϑΝΠϧΛ࡞੒ ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

  22. Xcode8ʹ͢Δͱ CircleCI্Ͱ ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠ ɾscanͰςετ ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠ ɾgymͰipaϑΝΠϧΛ࡞੒ ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

    ΄΅ࢮ๢ʘ(^o^)ʗśƂŦ
  23. Carthage࢖͑ͳ͍໰୊ ɾXcode8Ͱ͸ɺToolchainsʹSwift2.3༻ͱSwift3༻ͷ΋ͷ͕ ɹؚ·Ε͍ͯΔ ɹ$ ls /Applications/Xcode.app/Contents/Developer/Toolchains/ ɹSwift_2.3.xctoolchain XcodeDefault.xctoolchain ɾσϑΥϧτ͸Swift3ͷToolchain ɾexport

    TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 ɹͰSwift2.3Λར༻͢ΔΑ͏ʹઃఆ
  24. scanίέΔ໰୊ ɾXcode7·Ͱ͸destinationͰࢦఆ͍ͯͨ͠஋(OSɺ୺຤)ͰςετΛ ɹ࣮ߦ͢ΔΑ͏ʹͳ͍͕ͬͯͨɺXcode8͔Βແࢹ͞ΕΔΑ͏ʹɻ ɾ·ͨɺCircleCI্Ͱ͸derived_data_path͕௨ৗͷ ɹ~/Library/Developer/Xcode/DerivedData/Ͱ͸ͳ͘ɺ”/”ͱͳΓɺ ɹpermissionͷ໰୊Ͱςετ͕ίέΔΑ͏ʹɻ ɹˠద౰ͳ஋ΛSCAN_DERIVED_DATA_PATHʹઃఆͯ͠ରԠ

  25. gymίέΔ໰୊ ɾࠓ·Ͱ͸bundle install -j4 --path=vendor/bundleͰΠϯετʔϧ͠ɺ ɹbundle exec fast lane …Ͱ࣮ߦ͍ͯ͠Ε͹໰୊ͳ͔͕ͬͨɺ࠷৽൛

    ɹ(1.102.0 or 1.103.0)Ͱ͸Ұ෦ɺγεςϜඪ४rubyͷgem͕ࢀর͞ΕΔ ɹΑ͏ʹɻɻɻ(͓ͦΒ͘όά) ɹ ɾͦͷͨΊɺCircleCI্Ͱsudo gem install fastlaneͱͯ͠ରԠɻ ɹॺ໊͸ɺXcode8͔Βͷࣗಈબ୒Ͱ͸͏·͘ಈ͔ͳ͔ͬͨͨΊݸผʹઃఆ ɾଞʹ΋ੜ੒͞ΕΔipa/dSYMϑΝΠϧͷϕʔεωʔϜ͕มߋʹɻ ɹNext! Remote.ipa→App.ipa
  26. pilotίέΔ໰୊ ɾͲͪΒ͔ͱݴ͑͹ɺfastlaneΑΓiTunes Connectͷมߋɻ ɾpush௨஌ʹ͍ͭͯɺentitlements͕ͳͯ͘΋௨͍ͬͯͨ΋ͷ͕ ɹඞਢʹɻ ɾBluetoothΛ࢖༻͍ͯͨͨ͠Ίɺ ɹNSBluetoothPeripheralUsageDescriptionΛInfo.plistʹؚΊΔ ɹ͜ͱ͕ඞਢʹɻ

  27. ·ͱΊ ɾXcode8 x Swift2.3͸ͦΜͳʹେม͡Όͳ͍ ɾXcode8 x Swift3.x͸ΤίγεςϜͷߋ৽଴ͪɻ ɾXcodeपลͷࣗಈԽؔ܎͸ɺ·ͩͪΐͬͱෆ҆ఆ ɹ஍ཕ͸͋Β͔ͨ౿Έൈ͍ͨʂ(ന໨

  28. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

  29. ࢀߟ ɾίϚϯυϥΠϯπʔϧͰ͋ΒΏΔݴޠ͕࢖ΘΕ͍ͯͯ΋ߦ਺Λଌఆ͢Δ ɹ(http://qiita.com/GeneralD/items/c4351f42d0a441373033) ɾfastlane/fastlane ɹ(https://github.com/fastlane/fastlane) ɾBuilding dependencies with Swift 2.3

    rather than Swift 3 when using Xcode 8 Beta ɹ(https://github.com/Carthage/Carthage/issues/1351#issuecomment-226637835)