美文网首页
WWDC 2019 Debugging in Xcode11

WWDC 2019 Debugging in Xcode11

作者: Jerrydu96 | 来源:发表于2019-07-24 00:34 被阅读0次

    Device Conditions and Environment Overrides

    Device Conditions

    Device-wide induced condition
    Managed by Xcode
    Tied to Xcode device connection
    iOS status bar indicates when a condition is active
    Can be stopped on deivce

    Thermal state condition

    Raises thermal state to - fair, serious, or critical
    So you can reliably
    ·Understand app behavior under these elevated states
    ·Debug and verify your handling of thermal state changes

    Network link condition

    Real world profiles simulating network conditions
    ·High latency
    ·Low bandwidth
    ·High packet loss
    ·Slow DNS response
    So you can reliably
    ·Understand and debug app behavior under various network conditions

    Environment Overrides

    Demo

    可以设置网络状态和热状态?
    可以在底部控制台设置黑暗模式与否
    还可以更改控件大小来测试(SwiftUI)

    Override runtime environment of debugged app
    Overrides instantly
    Only affects debugged app
    System setting remain unchanged
    Supports devices simulator, and previews
    Available for all platforms


    image.png

    Debugging Live Previews

    Live previews are debuggable
    Workflows for previews
    SwiftUI runtime issues

    SwiftUI Runtime Issues

    Found when process is running
    Process continues executing
    Details in Issues Navigator
    All platforms and run destinations

    Demo

    直接改代码可以看到bug是否已经修复



    可以点击Runtime Issue Breakpoint,在运行过程中执行断点调试



    点击Editor-Previews-Refresh来进行刷新
    Debugging Workflow

    Use contextual menu to start debugging
    New debug session for source changes
    Keep the same file in main editor

    Debugging SwiftUI View Hierarchies

    Declarative API
    Composition and lightweight modifiers over complex views
    Value type semantics
    Platform specific views at runtime
    interoperability with UIKit and AppKit

    SwiftUI 和 UIKit and AppKit可以一起使用

    可以在右侧边栏看到具体的UI设定,从而加大找出问题的速度


    image.png

    View hierarchy in navigator and canvas
    Properties and modifiers in inspector
    Automatic inspector properties through Swift reflection
    Custom inspector properties by adopting CustomReflectable
    Support for mixed view hierarchies

    View Hierarchy Debugging Improvements

    UIWindowScene support
    Inspectors
    ·Trait collections
    ·Named images
    ·Symbol images
    ·Named colors
    ·Improved constraint details

    //More In WWDC
    Designing for Advers Network and Temperature Conditions
    LLDB: Beyond "po"
    

    相关文章

      网友评论

          本文标题:WWDC 2019 Debugging in Xcode11

          本文链接:https://www.haomeiwen.com/subject/tcgzlctx.html