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

iOSアプリのバッテリー消費を意識する/iosdc2020-ios-battery

ararajp
September 20, 2020

 iOSアプリのバッテリー消費を意識する/iosdc2020-ios-battery

ararajp

September 20, 2020
Tweet

More Decks by ararajp

Other Decks in Technology

Transcript

  1. © ZOZO Technologies, Inc. גࣜձࣾZOZOςΫϊϩδʔζ ZOZOTOWN෦ iOSνʔϜ ߥҪ ༐ีʢ͋ΒΒ/ararajpʣ 2006೥

    ϠϑʔגࣜձࣾʢݱɿZϗʔϧσΟϯάεגࣜձࣾʣ 2011೥ גࣜձࣾVASILY 2018೥ גࣜձࣾZOZOςΫϊϩδʔζ 2
  2. © ZOZO Technologies, Inc. WWDCؔ࿈ηογϣϯ 2013 Energy Best Practices 2014

    Writing Energy Efficient Code 2015 Achieving All-day Battery Life https://developer.apple.com/videos/play/wwdc2015/707/ Debugging Energy Issue https://developer.apple.com/videos/play/wwdc2015/708/ 12
  3. © ZOZO Technologies, Inc. WWDCؔ࿈ηογϣϯ 2016 Optimizing I/O for Performance

    and Battery Life https://developer.apple.com/videos/play/wwdc2016/719/ 2017 Writing Energy Efficient Apps https://developer.apple.com/videos/play/wwdc2017/238/ 2018 What’s New in Energy Debugging https://developer.apple.com/videos/play/wwdc2018/228/ 13
  4. © ZOZO Technologies, Inc. WWDCؔ࿈ηογϣϯ 2019 Improving Battery Life and

    Performance https://developer.apple.com/videos/play/wwdc2019/417/ 2020 Improve performance and battery life in your app https://developer.apple.com/news/?id=q8jd4xub 14
  5. © ZOZO Technologies, Inc. όοςϦʔʹؔ͢ΔΨΠυ 15 Energy Efficiency Guide for

    iOS Apps https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/ ɾGreat battery life. ɾCool device. ༏ΕͨϢʔβʔΤΫεϖϦΤϯεͷ৚݅ͱͯ͠ҎԼͷ2ؚ͕ͭ·Ε͍ͯΔ
  6. © ZOZO Technologies, Inc. Ϣʔβʔ޲͚ͷϖʔδ 16 όοςϦʔ - ύϑΥʔϚϯεʹؔ͢Δώϯτ ɾը໘ͷ໌Δ͞ௐ੔

    ɾ௿ిྗϞʔυ ɾपลԹ౓ https://www.apple.com/jp/batteries/maximizing-performance/
  7. © ZOZO Technologies, Inc. 25 Energyͷ2ͭͷཁૉ Overhead ɾඞཁͳϋʔυ΢ΣΞΛγεςϜʹཁٻ͢Δ࣌ʹൃੜ͢ΔΤωϧΪʔ ɾ௚઀͸੍ޚͰ͖ͳ͍ Active

    Energy ɾαϒγεςϜΛ࢖༻͢Δ࣌ʹ࠷ॳʹൃੜ͢ΔΤωϧΪʔ ɾαϒγεςϜΛ࢖༻͢Δ͜ͱͰΧϝϥͳͲʹΞΫηε͢Δ
  8. © ZOZO Technologies, Inc. 30 ωοτϫʔΩϯά Cellular / Wi-Fi /

    BluetoothΛհͯ͠௨৴Λ͢ΔͱΤωϧΪʔΛফඅ ফඅ͕ଟ͘ͳΔཁҼ ɾ௨৴ྔ͕ଟ͍ͱ૿͑Δ ɾωοτϫʔΫϦΫΤετ͕૿͑Ε͹ΤωϧΪʔ΋૿͑Δ
  9. © ZOZO Technologies, Inc. 37 Average Energy Impact ɾΤωϧΪʔͷফඅྔΛ૬ରతʹࣔ͢ήʔδ ɾZero

    / Low / High / VeryHighͷஈ֊͕͋Δ ɾফඅྔΛ૬ରతʹ͍ࣔͯ͠ΔͷͰଥ౰͔൑அ͢Δͷ͕େࣄ ૝ఆ௨Γͳͷ͔σϕϩούʔͷ൑அʹ ҕͶΒΕ͍ͯΔ
  10. © ZOZO Technologies, Inc. 44 Xcode Energy Logs ɾσόΠε্Ͱੜ੒͞Ε໰୊͕ใࠂ͞ΕΔ ɾTestFlight

    / App Store΁഑෍ࡁͷΞϓϦͷ໰୊͕೺ѲͰ͖Δ ɹɾCPU͕ଟ͘࢖ΘΕΔΠϕϯτ ɹɾ໰୊ͷίʔυ
  11. © ZOZO Technologies, Inc. 45 Xcode Energy Logs ɾੜ੒λΠϛϯά͸1%ͷόοςϦʔ௿Լ͕ൃੜ͢Δ࣌ ɹɾϑΥΞάϥ΢ϯυͰCPU࢖༻཰80%Ҏ্͕3෼Ҏ্

    ɹɾόοΫάϥ΢ϯυͰCPU࢖༻཰80%Ҏ্͕1෼Ҏ্ ɾAppleʹϩάΛૹ৴ ɾApple͕ू໿ͯ͠ϦετΞοϓ͞ΕΔ ɾXcode Energy OrganizerΛ࢖༻ͯ͠Ӿཡ͢Δ
  12. © ZOZO Technologies, Inc. 48 Xcode Energy Organizer Window ->

    Organizer -> Energyλϒ͔Β֬ೝͰ͖Δ ɾ໰୊ͷ಺༰ ɾDevice / iOSͳͲͷϝλ৘ใ ɾελοΫτϨʔε͔Β௚઀໰୊ͷίʔυΛ։͍ͯσόοά