Slide 1

Slide 1 text

2019 DevDay Speed Up iOS Development With LLDB Code Injection and Framework Live Preview > ChienJu Lin > LINE Taiwan Engineering 7 iOS Developer

Slide 2

Slide 2 text

General Development Flow Product Verify Dev Spec Build

Slide 3

Slide 3 text

Pain Point - Long Build Time Product Dev Spec Build Verify

Slide 4

Slide 4 text

Reduce Number of Times
 To Rebuild Whole App

Slide 5

Slide 5 text

Build only the module that currently working on Less Compile Source Count Only Build the Framework Less Build Time

Slide 6

Slide 6 text

> Not embedded/linked by others Clean refactoring might need lots of works Tips for Existing Projects Apply Dummy Framework First Easier To Apply, Refactor Afterwards

Slide 7

Slide 7 text

How To Verify VIEW in Framework?

Slide 8

Slide 8 text

> No need many scrolls and clicks > Preview with different language / device size Interactive Fast Access Preview Under Different Environment SwiftUI / Playground Live Preview > Preview in different view state

Slide 9

Slide 9 text

How To Verify LOGIC in Framework?

Slide 10

Slide 10 text

Test Driven Development in Playground To build faster at every iteration Write Failing Test Make It Pass Refactor Unit Tests / TDD are best to verify logic > Unit Test the framework in playground for interactive environment > Move to test target for CI after completion

Slide 11

Slide 11 text

How To Speed Up Whole App Verification?

Slide 12

Slide 12 text

LLDB Code Injection Modify control flow without rebuild Inject new code using LLDB Command

Slide 13

Slide 13 text

LLDB Code Injection - Example Goal: Inject new view model to asynchronously download

Slide 14

Slide 14 text

LLDB Code Injection - Example 1. Insert breakpoint, enter multi-line expression mode

Slide 15

Slide 15 text

LLDB Code Injection - Example 2. Inject new view model code

Slide 16

Slide 16 text

LLDB Code Injection - Example 3. Execute the injected function

Slide 17

Slide 17 text

LLDB Code Injection - Example 4. Wait the async task to complete. Retrigger the breakpoint, check result & Done.

Slide 18

Slide 18 text

Framework Code Injection Preview Summary

Slide 19

Slide 19 text

Reduce Number of Times
 To Rebuild Whole App

Slide 20

Slide 20 text

Thank You