kkbox wwdc17 performance and testing - hokila

86
詹岳勳 Hokila WWDC session summary

Upload: liyao-chen

Post on 22-Jan-2018

2.108 views

Category:

Technology


2 download

TRANSCRIPT

詹岳勳 Hokila

WWDC session summary

App Startup Time: Past, Present, and Future

Writing Energy Efficient Apps

What's New in Testing

Engineering for Testability

feature Improvement you may never use

Some Energy you may waste in background

UI Test & Unit Test New feature on Xcode 9

Test Code Best Practice

What is Dyld the dynamic link editor

App Startup time

Things you may do in didFinishLaunchingWithOptions

• load user setting• set appearance• init view controller• load 3rd party module

• it’s better to finish in 600ms

Static initializer tracing

find out what is slowly as same time profile

energy efficient app setting -> battery

Reloads on a timer

Async test before

• XCTWaiter : Takes control over to the waiting

strategy.

• XCTNSPredicateExpectation: Readable expectation

while writing automate tests

• XCTKVOExpectation: Readable expectation while writing automate tests

• XCTDarwinNotificationExpectation: Another readable expectation for notifications.

•pxctesthttps://github.com/plu/pxctest

•FBSimulatorControl https://github.com/facebook/FBSimulatorControl

headless test with xcodebuild without launch of sumulator

$ xcodebuild -scheme "Xcode9-XCTest" -destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=11.0' build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

Run Test in parallel

$ xcodebuild -scheme "Xcode9-XCTest" -destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=11.0'-destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=10.3' build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

Multiple app test sample code

Multiple app test Demo