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

Dem Fehler auf der Spur - Mobile Testing Days 2015

Dem Fehler auf der Spur - Mobile Testing Days 2015

Eine Expedition in die (Objective-C) Debugging Toolchain von iOS.
Talk gehalten auf den Mobile Testing Days in Berlin am 28. Mai 2015.

Florian

May 28, 2015
Tweet

More Decks by Florian

Other Decks in Technology

Transcript

  1. Incident Identifier: 63569671-4940-4162-B76F-D3AD44A607F0 CrashReporter Key: 09B60E97-4A43-4092-8C6A-51B4406BE34A Hardware Model: iPhone6,2 Process:

    App [268] Path: /private/var/mobile/Containers/Bundle/Appl Identifier: de.inhofer.app.beta Version: 101 Code Type: ARM-64 Parent Process: launchd [1] Date/Time: 2014-09-23T15:03:07Z OS Version: iPhone OS 8.0 (12A365) Report Version: 104 Exception Type: SIGABRT Exception Codes: #0 at 0x197c73270 Crashed Thread: 0 Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArg …
  2. “Debugging is twice as hard as writing the code in

    the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” —Brian Kernighan
  3. - (id)calculateWithThing:(Thing *)t { Calc* calc = [self calcForThing:t]; Thing

    *other = [self otherThing]; Result *result = [self doCalculation:calc withOtherThing:other]; return result; }
  4. - (id)calculateWithThing:(Thing *)t { Calc* calc = [self calcForThing:t]; Thing

    *other = [self otherThing]; Result *result = [self doCalculation:calc withOtherThing:other]; return result; }
  5. - (id)calculateWithThing:(Thing *)t { Calc* calc = [self calcForThing:t]; Thing

    *other = [self otherThing]; Result *result = [self doCalculation:calc withOtherThing:other]; return result; }
  6. - (id)calculateWithThing:(Thing *)t { Calc* calc = [self calcForThing:t]; Thing

    *other = [self otherThing]; Result *result = [self doCalculation:calc withOtherThing:other]; return result; }
  7. +++ b/Test.xcodeproj/xcshareddata/xcdebugger/ Breakpoints_v2.xcbkptlist @@ -2,4 +2,22 @@ <Bucket type =

    "4" version = "2.0"> + <Breakpoints> + <BreakpointProxy + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> + <BreakpointContent + shouldBeEnabled = "Yes" + ignoreCount = "0" + continueAfterRunningActions = "No" + filePath = "Test/ViewController.swift" + timestampString = "454418607.219209" + startingColumnNumber = "9223372036854775807" + endingColumnNumber = "9223372036854775807" + startingLineNumber = "15" + endingLineNumber = "15" + landmarkName = "viewDidLoad()"
  8. +++ b/Test.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,4 +2,22 @@ <Bucket type = "4"

    version = "2.0"> + <Breakpoints> + <BreakpointProxy + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> + <BreakpointContent + <Actions> + <BreakpointActionProxy> + ActionExtensionID = “Xcode.BreakpointAction.Log"> + <ActionContent + message = "Hello Mobile Testing Days" + conveyanceType = "0"> + </ActionContent> + </BreakpointActionProxy> + </Actions>
  9. (lldb) po self.view.frame error: property 'frame' not found on object

    of type 'UIView *' error: 1 errors parsing expression
  10. (lldb) po self.view.window nil (lldb) po self.view.frame error: property 'frame'

    not found on object of type 'UIView *' error: 1 errors parsing expression (lldb) expr @import UIKit
  11. (lldb) po self.view.frame (origin = (x = 0, y =

    0), size = (width = 320, height = 568)) (origin = (x = 0, y = 0), size = (width = 320, height = 568))
  12. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/ XMLSchema-instance" xsi:schemaLocation="http:// www.topografix.com/GPX/1/1

    http:// www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" <wpt lat="52.509678" lon="13.399576"> <time>2015-05-27T19:29:40Z</time> </wpt> </gpx>
  13. Links - lldb-command-examples - LLDB-QuickLook - chisel - CocoaLumberjack -

    NSLogger - NSLogger-CocoaLumberjack-connector - Reveal - Spark Inspector
  14. Links - Symbolic breakpoint for sychronous network call on main

    thread - SimPholders - ClangFormat-Xcode - Apple-clang-format - SwiftLint - Faux Pas