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

XCLogParser, SwitUI primeras impresiones

XCLogParser, SwitUI primeras impresiones

During the first part of this talk, Erick Camacho (#spotify #engineer), tells us about the #XCLogParser project focused on obtaining everything you need to know about Xcode's hidden logs

In the second part of the talk, the hosts, Abdiel Soto(@abdielsba), Gandhi Mena(@gandhimena), Iván Alvarez(@ivanhoe) talk about their first impressions regarding the launch of #SwfitUI days after it was launched

iosdevelopersmx

February 12, 2022
Tweet

More Decks by iosdevelopersmx

Other Decks in Programming

Transcript

  1. Agenda • The format - The tooling This is a

    story about a journey full of mistery and marvels inside Xcode
  2. The LogStoreManifest • List of existing xcactivitylog files in the

    directory • Some basic data: name of the project, build time, etc.
  3. The rest of the content is a collection of these

    types: Integer Array Double Class name nil Class instance String
  4. Double Type delimiter: ^ Example: afd021ebae48c141^ • Tip: The double

    is encoded in Hexadecimal • Tip: Used to store Dates (timeIntervalSince1970)
  5. String Type delimiter: " Example: 5"Hello • Tip: The left

    hand integer is the length of the String. • Tip: Count the chars after the delimiter.
  6. Array Type delimiter: ( Example: 12( • Tip: The left

    hand side value indicates the number of elements in the List.
  7. Class name Type delimiter: % Example: 21%IDEActivityLogSection • Tip: The

    left hand value is the length of the name • Tip: The right hand value is the name of the Class.
  8. Class instance The value is the index of the Class

    name of the instance's type. Everytime you find a Class name you assign an index to it. The left hand value of a Class instance is that index. All the values after a Class reference may be attributes of the class instance.
  9. [type: int, value: 10], [type: className, name: "IDEActivityLogSection"], [type: classNameRef,

    className: "IDEActivityLogSection"], [type: int, value: 0], [type: string, value: "Xcode.IDEActivityLogDomainType.BuildLog"], [type: string, value: "Build XCLogParserApp"], [type: string, value: "Build XCLogParserApp"], [type: double, value: 580158292.767495], [type: double, value: 580158295.086277], [type: list, count: 11], [type: classNameRef, className: "IDEActivityLogSection"], [type: int, value: 1], [type: string, value: "Xcode.IDEActivityLogDomainType.XCBuild.Preparation"], [type: string, value: "Prepare build"], [type: string, value: "Prepare build"], [type: double, value: 580158292.82973], [type: double, value: 580158292.853954], [type: nil]
  10. List the Class names found in the logs • IDEActivityLogSection

    • IDEActivityLogUnitTestSection • IDEActivityLogMessage • DVTDocumentLocation • DVTTextDocumentLocation
  11. Third clue: They are part of the IDEFoundation.framework Thanks to

    @luisobo https://github.com/luisobo/Xcode-RuntimeHeaders
  12. 1. Start with a Class 2. Get the N tokens

    after the Class instance (Where N is the number of properties in the Header file) 3. Assign those tokens to instance variables. Criteria: type, order 4. When in doubt: get more logs 5. Repeat
  13. Use cases • In your CI to generate build time

    artifacts. • Benchmark build times • Locally to diagnose build problems.
  14. Use cases • To gatekeep Pull Request that introduce new

    warnings • To analyze how parallelized your builds are and improve them. • To gatekeep Pull Request that introduce longer build times.
  15. We need your help • Give it a try, the

    more logs we can try it with, the better • Contribute!