SlideShare une entreprise Scribd logo
1  sur  25
Bugs are what we *thought* we told
the computer to do vs. what we
actually told the computer to do
- Javier Soto, iOSConf Singapore 2015
Do you do debugging on
a regular basis?
Do you love debugging?
Developing for iOS is
complicated
• Multiple platforms - iOS, watchOS, tvOS
Multiple devices - iPhone, iPad, Apple Watch, Apple TV
Apps vs. extensions
September 9, 1947
First Instance of Actual Computer Bug Found
KISS
Keep It
Simple
, Stupidand
Smart
Test on Device!
Don’t rely on just the simulator for all your testing.
If you notice a bug (or strange behaviour) on the simulator, test on a
device (or several devices) too.
Some issues are there just on the simulator and this can cause you
many wasted hours.
Me, after hours of
Simulator Debugging
Trust in the Google
Search to see if others have encountered the issue. In most cases,
they probably have.
If you’re working with a beta version of iOS/Xcode, the Apple
developer forums (http://forums.developer.apple.com/) will almost
always have somebody else talking about the issue.
What Changed?
Version control systems are your friend - they can help you identify
what actually changed when you did that last revision
Compare versions to see if you can identify the change that is
causing the bug you see.
Git Outta Here
Git isn’t just for the command-line any more!
• Xcode - Built-in source control functionality.
• SourceTree - Free. Works with both Git and Mercurial
repositories. http://sourcetree.com
• GitUp - Free. Allows you to do some complicated operations via
the GUI. http://gitup.co
• GitHub Desktop - Free. Integrates with GitHub workflow.
https://desktop.github.com
• Git Tower - Paid. Beautiful, clean, and functional UI. http://git-
tower.com
Crash Logs
Crash logs provide a lot of valuable information to identify the root
cause for a bug.
Third party tools can help too:
• Crashlytics/Fabric - Tiny footprint, easy to set up. Now owned by
Twitter. http://fabric.io
• Hockey - Multi-platform - Android, iOS, Windows, Unity. Now
owned by Microsoft. http://hockeyapp.net
Pare it Down!
Have a bug in a complicated project?
Simplify it!
Clone and reduce the project down to the simplest form possible
where the bug is still present.
Basic Xcode Debugging
• Break points - The basic tool of debugging
• Logging - Get rid of all those NSLog statements …
• Watch points - How do you know when a variable changes?
• Symbol breakpoints - Break on specific methods.
• Exception breakpoints - Catching those elusive crashes
Conditional Breaks
Break on specific iterations or conditions by adding a condition to the
breakpoint
Threads
Thread debugging - how do you debug interactions between multiple
threads?
Views
View debugging - what do you do?
Views
View debugging - a better way?
Reveal app - http://revealapp.com
Autolayout
Autolayout constraint issues - how do you debug?
Questions?
More questions? Or need help with debugging? Or want to discuss
debugging related stuff?
Contact me via e-mail at:
fahim@rooksoft.sg
Or on Twitter:
@FahimFarook

Contenu connexe

En vedette

Slideshow Excursie Istanbul 2010
Slideshow Excursie Istanbul 2010Slideshow Excursie Istanbul 2010
Slideshow Excursie Istanbul 2010hanshuizinga
 
Peru slideshow2
Peru slideshow2Peru slideshow2
Peru slideshow2R.J.
 
Eskola 2.0 ondorioa
Eskola 2.0 ondorioaEskola 2.0 ondorioa
Eskola 2.0 ondorioaMaitane
 
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010Thom Kearney culture of collaboration PHAC KE Forum Nov 2010
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010Thom Kearney
 
NOB irányelvek a közösségi média használatáról
NOB irányelvek a közösségi média használatárólNOB irányelvek a közösségi média használatáról
NOB irányelvek a közösségi média használatárólMihály Zsiros
 
Community Stress Prevention Center
Community Stress Prevention CenterCommunity Stress Prevention Center
Community Stress Prevention CenterICSPC
 
Presentación1
Presentación1Presentación1
Presentación1pggarde
 
Mind Behind Movement
Mind Behind MovementMind Behind Movement
Mind Behind Movementguest2a787e1
 
AHLIST 2012 - The concept of Book as a Service
AHLIST 2012 - The concept of Book as a ServiceAHLIST 2012 - The concept of Book as a Service
AHLIST 2012 - The concept of Book as a Service24Symbols
 
Estimating Human Pose from Occluded Images (ACCV 2009)
Estimating Human Pose from Occluded Images (ACCV 2009)Estimating Human Pose from Occluded Images (ACCV 2009)
Estimating Human Pose from Occluded Images (ACCV 2009)Jia-Bin Huang
 
Presentation1
Presentation1Presentation1
Presentation1maiko
 
Syllabuses ttc two year course
Syllabuses ttc  two year courseSyllabuses ttc  two year course
Syllabuses ttc two year coursenongni
 
Paper price increase
Paper price increasePaper price increase
Paper price increasesamsonoffice
 

En vedette (20)

Corpus
CorpusCorpus
Corpus
 
Slideshow Excursie Istanbul 2010
Slideshow Excursie Istanbul 2010Slideshow Excursie Istanbul 2010
Slideshow Excursie Istanbul 2010
 
Peru slideshow2
Peru slideshow2Peru slideshow2
Peru slideshow2
 
Jenerasyon is tanıtımı_2010
Jenerasyon is tanıtımı_2010Jenerasyon is tanıtımı_2010
Jenerasyon is tanıtımı_2010
 
Eskola 2.0 ondorioa
Eskola 2.0 ondorioaEskola 2.0 ondorioa
Eskola 2.0 ondorioa
 
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010Thom Kearney culture of collaboration PHAC KE Forum Nov 2010
Thom Kearney culture of collaboration PHAC KE Forum Nov 2010
 
Confirmation lesson 4 8 b
Confirmation lesson 4 8 bConfirmation lesson 4 8 b
Confirmation lesson 4 8 b
 
10 02 16 Veb Strategic Planning Meeting
10 02 16 Veb Strategic Planning Meeting10 02 16 Veb Strategic Planning Meeting
10 02 16 Veb Strategic Planning Meeting
 
NOB irányelvek a közösségi média használatáról
NOB irányelvek a közösségi média használatárólNOB irányelvek a közösségi média használatáról
NOB irányelvek a közösségi média használatáról
 
Enterprise & Transcoimmunication
Enterprise & TranscoimmunicationEnterprise & Transcoimmunication
Enterprise & Transcoimmunication
 
Karrier 2.0
Karrier 2.0Karrier 2.0
Karrier 2.0
 
Community Stress Prevention Center
Community Stress Prevention CenterCommunity Stress Prevention Center
Community Stress Prevention Center
 
Presentación1
Presentación1Presentación1
Presentación1
 
Mind Behind Movement
Mind Behind MovementMind Behind Movement
Mind Behind Movement
 
AHLIST 2012 - The concept of Book as a Service
AHLIST 2012 - The concept of Book as a ServiceAHLIST 2012 - The concept of Book as a Service
AHLIST 2012 - The concept of Book as a Service
 
Mind the gap between the new portfolio and the so-called old systems
Mind the gap between the new portfolio and the so-called old systemsMind the gap between the new portfolio and the so-called old systems
Mind the gap between the new portfolio and the so-called old systems
 
Estimating Human Pose from Occluded Images (ACCV 2009)
Estimating Human Pose from Occluded Images (ACCV 2009)Estimating Human Pose from Occluded Images (ACCV 2009)
Estimating Human Pose from Occluded Images (ACCV 2009)
 
Presentation1
Presentation1Presentation1
Presentation1
 
Syllabuses ttc two year course
Syllabuses ttc  two year courseSyllabuses ttc  two year course
Syllabuses ttc two year course
 
Paper price increase
Paper price increasePaper price increase
Paper price increase
 

Similaire à Debugging Tips and Tricks - iOS Conf Singapore 2015

Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedWojciech Koszek
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with AppiumSrijan Technologies
 
iPhone App from concept to product
iPhone App from concept to productiPhone App from concept to product
iPhone App from concept to productjoeysim
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy VirinCocoaHeads France
 
Cucumber meets iPhone
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhoneErin Dees
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, UkraineJustin Ison
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)danielputerman
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moetEing Ong
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitcbenDesigning
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in ActionBill Scott
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"DataArt
 
MOET: Mobile End-to-End Testing
MOET: Mobile End-to-End TestingMOET: Mobile End-to-End Testing
MOET: Mobile End-to-End Testingmobiletestsummit
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in ActionBill Scott
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachITCamp
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp
 

Similaire à Debugging Tips and Tricks - iOS Conf Singapore 2015 (20)

Building an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learnedBuilding an Open Source iOS app: lessons learned
Building an Open Source iOS app: lessons learned
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
 
iPhone App from concept to product
iPhone App from concept to productiPhone App from concept to product
iPhone App from concept to product
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy Virin
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
 
Cucumber meets iPhone
Cucumber meets iPhoneCucumber meets iPhone
Cucumber meets iPhone
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, Ukraine
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
2012 mobile testingsummit-moet
2012 mobile testingsummit-moet2012 mobile testingsummit-moet
2012 mobile testingsummit-moet
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitc
 
Is Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic GascIs Python still production ready ? Ludovic Gasc
Is Python still production ready ? Ludovic Gasc
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 
Android studio
Android studioAndroid studio
Android studio
 
A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"A. Sirota "Building an Automation Solution based on Appium"
A. Sirota "Building an Automation Solution based on Appium"
 
MOET: Mobile End-to-End Testing
MOET: Mobile End-to-End TestingMOET: Mobile End-to-End Testing
MOET: Mobile End-to-End Testing
 
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
8 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent Ellerbach
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
From open source labs to ceo methods and advice by sysfera
From open source labs to ceo methods and advice by sysferaFrom open source labs to ceo methods and advice by sysfera
From open source labs to ceo methods and advice by sysfera
 

Dernier

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 

Dernier (7)

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 

Debugging Tips and Tricks - iOS Conf Singapore 2015

  • 1. Bugs are what we *thought* we told the computer to do vs. what we actually told the computer to do - Javier Soto, iOSConf Singapore 2015
  • 2.
  • 3. Do you do debugging on a regular basis?
  • 4. Do you love debugging?
  • 5. Developing for iOS is complicated • Multiple platforms - iOS, watchOS, tvOS Multiple devices - iPhone, iPad, Apple Watch, Apple TV Apps vs. extensions
  • 6.
  • 7. September 9, 1947 First Instance of Actual Computer Bug Found
  • 8.
  • 10. Test on Device! Don’t rely on just the simulator for all your testing. If you notice a bug (or strange behaviour) on the simulator, test on a device (or several devices) too. Some issues are there just on the simulator and this can cause you many wasted hours.
  • 11. Me, after hours of Simulator Debugging
  • 12. Trust in the Google Search to see if others have encountered the issue. In most cases, they probably have. If you’re working with a beta version of iOS/Xcode, the Apple developer forums (http://forums.developer.apple.com/) will almost always have somebody else talking about the issue.
  • 13. What Changed? Version control systems are your friend - they can help you identify what actually changed when you did that last revision Compare versions to see if you can identify the change that is causing the bug you see.
  • 14. Git Outta Here Git isn’t just for the command-line any more! • Xcode - Built-in source control functionality. • SourceTree - Free. Works with both Git and Mercurial repositories. http://sourcetree.com • GitUp - Free. Allows you to do some complicated operations via the GUI. http://gitup.co • GitHub Desktop - Free. Integrates with GitHub workflow. https://desktop.github.com • Git Tower - Paid. Beautiful, clean, and functional UI. http://git- tower.com
  • 15. Crash Logs Crash logs provide a lot of valuable information to identify the root cause for a bug. Third party tools can help too: • Crashlytics/Fabric - Tiny footprint, easy to set up. Now owned by Twitter. http://fabric.io • Hockey - Multi-platform - Android, iOS, Windows, Unity. Now owned by Microsoft. http://hockeyapp.net
  • 16. Pare it Down! Have a bug in a complicated project? Simplify it! Clone and reduce the project down to the simplest form possible where the bug is still present.
  • 17. Basic Xcode Debugging • Break points - The basic tool of debugging • Logging - Get rid of all those NSLog statements … • Watch points - How do you know when a variable changes? • Symbol breakpoints - Break on specific methods. • Exception breakpoints - Catching those elusive crashes
  • 18.
  • 19. Conditional Breaks Break on specific iterations or conditions by adding a condition to the breakpoint
  • 20. Threads Thread debugging - how do you debug interactions between multiple threads?
  • 21. Views View debugging - what do you do?
  • 22. Views View debugging - a better way? Reveal app - http://revealapp.com
  • 24.
  • 25. Questions? More questions? Or need help with debugging? Or want to discuss debugging related stuff? Contact me via e-mail at: fahim@rooksoft.sg Or on Twitter: @FahimFarook