Debugging in Xcode 13: Tips & Tricks (2022) - iOS

Sdílet
Vložit
  • čas přidán 16. 07. 2024
  • In today's video we will look at various D bugging techniques in ex code 13. We will dive into the world of breakpoints, symbolic break points, injection of code, the LLDb debugger, and a variety of other tools. We will debug a real world application to get a sense of what we can do using Swift.
    💻 Source Code: / iosacademy
    🎥 Subscribe for more: czcams.com/users/iOSAcademy?su...
    😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
    👉🏼 Connect (personal LinkedIn) / afrazsiddiqui
    🚀 Follow on LinkedIn / ios-academy
    ** Popular Series
    Building Instagram: courses.iosacademy.io/p/build...
    Building TikTok: / @iosacademy
    SwiftUI for Beginners: ios-academy.teachable.com/p/s...
    ** Get Skillshare free for 2 Months and learn iOS
    www.skillshare.com/r/user/afraz
    ** Manage all your investments from app earnings on Betterment!
    bit.ly/3eBwlI9
    ** Grow your own CZcams tech channel with TubeBuddy:
    www.tubebuddy.com/iosacademy
    #swift #Xcode #iOS

Komentáře • 64

  • @IamJewz
    @IamJewz Před 2 lety +25

    The expression tip for runtime injection is really useful in large code bases, a real hidden gem 💎

  • @driosman
    @driosman Před 2 lety +2

    Great content as usual, can't believe that watching this video helped me debug a weird bug(I did not even know where to start before), thanks so much for producing great content, that'd normally be expensive to access

  • @asifnazir5832
    @asifnazir5832 Před 2 lety +2

    Injecting code on runtime is gonna save lot of time, really helpful techniques. Thanks.

  • @KimbrellBrad
    @KimbrellBrad Před 2 lety +1

    Learned several things that I was not aware were available. Great start and ready to see your future debugging videos! Some topics I would like are setting breakpoints based on values and how to trace down some of these "Failed to log metrics" errors in SwiftUI. Thanks for the video!

  • @dream_emulator
    @dream_emulator Před rokem

    Thanks so much for this content 🙏 Really helps me out

  • @mustafahamza6489
    @mustafahamza6489 Před 2 lety +1

    Really helpful debugging tips. Thank you for making this video!

  • @bachukibitsadze526
    @bachukibitsadze526 Před 2 lety +1

    Those are really helpful tips 💪🏻

  • @captainmichaelj2321
    @captainmichaelj2321 Před 2 lety +1

    Always love your video, I have to mention that your code and tutorials are basis of my first iOS app that I am still working on. Would also appreciate it if you can share more insights about different architectures, specifically, I heard about TCA, while I developed my app in MVVM (UIKit + SwiftUI + Combine). Some people mention that SwiftUI should not be using MVVM.

  • @shurale85
    @shurale85 Před rokem

    Thanks man! I found it really usefull.

  • @AmitBiswastunebox
    @AmitBiswastunebox Před 2 lety +1

    Wow Finally you did it Afraz. Thanks a lot brother. You are generous and genuine. Looking forward to learn a tons of iOS stuffs from you. Again Thanks a lot and means a lot as I was requesting you couple of times.

    • @iOSAcademy
      @iOSAcademy  Před 2 lety +1

      Youre very welcome! Always try to do my best

    • @AmitBiswastunebox
      @AmitBiswastunebox Před 2 lety

      @@iOSAcademy You are doing phenomenal and Your iOS Academy will be the best learning resources on iOS Programing. Even I always shared this channel with my friends and co-workers. Keep reaching the Star ! Respect and Love from New York.

  • @user-yd9xy3rb4x
    @user-yd9xy3rb4x Před 2 lety +1

    This is a great refresher. 👍🏻

  • @Stricken174
    @Stricken174 Před 4 měsíci

    just awesome!

  • @SwiftfulThinking
    @SwiftfulThinking Před 2 lety +1

    These are awesome 🔥

  • @saurabhbhambry
    @saurabhbhambry Před 2 lety +1

    Great video! Hands down one of the best video I've seen on LLDB (believe me I've searched near & far :) ).
    Hopefully, you can make another more detailed follow-up video for advanced debugging too - with specific focus on detecting/debugging constraint issues.

    • @iOSAcademy
      @iOSAcademy  Před 2 lety

      Thanks

    • @fermatslasttheorem6298
      @fermatslasttheorem6298 Před 2 lety

      If you want very in-depth and more descriptive information that you didn't even know exist, I recommend watching the Apple WWDC debugging videos, especially since 2018 it's still relevant.

  • @MarkizBoneco
    @MarkizBoneco Před rokem

    very useful video. Thank you!

  • @ramazanabdullayev1969
    @ramazanabdullayev1969 Před 2 lety +1

    Printing View Hierarchy is very helpful technique in a large projects. Thanks man!

    • @iOSAcademy
      @iOSAcademy  Před 2 lety +1

      Youre welcome

    • @fermatslasttheorem6298
      @fermatslasttheorem6298 Před 2 lety

      You can also do "expression -l objc -O -- [`self.view` recursiveDescription]" if you've hit a breakpoint inside a UIViewController. The "`self.view`" is Swift code, the rest is Objective-C format. Idk why CZcams is adding a strikethrough format but it's dash l and dash O.

  • @luntumavukuza4311
    @luntumavukuza4311 Před 2 lety +1

    I have learned something, thank you

  • @iosonpractice
    @iosonpractice Před rokem

    Thank you ​@iOS Academy, your lessons help me to become iOS developer and finally get hired

    • @iOSAcademy
      @iOSAcademy  Před rokem +1

      Congrats! Huge props to you and your hard work

  • @ndetetv666
    @ndetetv666 Před rokem

    thank you so much

  • @ilyablinov4979
    @ilyablinov4979 Před 2 lety +1

    Thanks a lot:)

  • @timotiusleonardo1966
    @timotiusleonardo1966 Před 2 lety +1

    It really surprise me when i watch the injecting expression through breakpoint scene. I wish i know that a little bit sooner hehehe, Thanks Afraz!

  • @tejaspatelia8179
    @tejaspatelia8179 Před 7 měsíci

    Conditional break point is another great debugging feature

  • @ammarmujib
    @ammarmujib Před rokem

    runtime injection can be really useful as well as symbolic breakpoint. Can we use symbolic breakpoint for variables? If not then whats the alternative for watch var in Xcode and how to use it.?

  • @AmitBiswastunebox
    @AmitBiswastunebox Před 2 lety

    Hi Brother, Hope you are doing well. I have a request. I recently tried to learn about iOS login Authentication and how it works while you have a sign in option in your app and under the hood how to pass the token, where to store and how the mechanism works. I encountered this questions a lot overtime. When you get chance, please create a tutorial on top of it please please. Thanks a lot.

  • @greasowang6144
    @greasowang6144 Před 2 lety +1

    😃Tks

  • @victorriurean
    @victorriurean Před 2 lety +1

    🔥🔥🔥

  • @dream_emulator
    @dream_emulator Před rokem

    What is a frame in the debugging context?

  • @frijevc
    @frijevc Před rokem

    When I throw swift error in expression nothing happens, but it works without lldb error.

  • @vitys1000
    @vitys1000 Před 2 lety

    When I type expr -l objc -O --[UIViewController _printHierarchy], console - error: :1:2: use of undeclared identifier 'l' (My app write on swift UI). Hpw I can resolve that?

  • @jorgeivesmurilloparedes1906

    Hello ,I paid the subscription to get the source code but I can not fin it, can you help me

  • @RobertShresthawolf
    @RobertShresthawolf Před 2 lety +1

    🤯🤯🤯🤯🤯

  • @asigivati1382
    @asigivati1382 Před rokem

    thanks for this useful video!
    it's only me thinking that Xcode's debugger is the worst thing ever?
    all the time when i'm trying to debug something he doesn't know what i want from him or what to do.
    i always get errors like:
    error: expression failed to parse:
    error: Couldn't realize type of self.
    or
    error: expression failed to parse:
    error: :2:11: error: cannot find type '$__lldb_context' in scope
    extension $__lldb_context {
    ^~~~~~~~~~~~~~~
    even for the simplest code, it doesn't understand what I want from it and it's very frustrating.
    i can't believe the apple have such a bad product.

  • @user-yd9xy3rb4x
    @user-yd9xy3rb4x Před 2 lety

    3:50 my designers are evil 🤣

  • @jaylensmith6308
    @jaylensmith6308 Před 2 lety

    (lldb) aka Thanos snapped his fingers

  • @michaelnajera7958
    @michaelnajera7958 Před 2 lety

    What is your accent?

    • @iOSAcademy
      @iOSAcademy  Před 2 lety

      I dont think I have one?

    • @casadogaspar
      @casadogaspar Před 2 lety +1

      @@iOSAcademy Probably from USA, as they think they don't have an accent 🤣

  • @tokero5199
    @tokero5199 Před 2 lety +1

    Great video. To avoid typing in long commands in lldb it's pretty simple to create an alias in .lldbinit. Looking into FB's chisel is also worth it it has a lot of useful stuff, ie. the print hierarchy is simply "pvc"