The Full Guide to Debugging Your Android Apps - Android Studio Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

ความคิดเห็น • 68

  • @SriHarshaChilakapati
    @SriHarshaChilakapati 2 ปีที่แล้ว +39

    Drop frame is dangerous, so don't rely on it unless absolutely necessary. What it resets is the function state and moves back the instructions. However, by then if any instructions are happened, like start a thread, the thread will still continue and not be stopped abruptly because you dropped a frame. If one of the instructions adds a value to a list (outside of function, eg., class member) then that value won't be removed back.

    • @wizardy6267
      @wizardy6267 2 ปีที่แล้ว +2

      Is it safe to say the drop frame destory the current stack but won't change the heap?

    • @SriHarshaChilakapati
      @SriHarshaChilakapati 2 ปีที่แล้ว +1

      @@wizardy6267 Yes, exactly

    • @b4ux1t3-tech
      @b4ux1t3-tech 2 ปีที่แล้ว +7

      For what it's worth, you're not wrong, but this is why it's important to abide by things like separation of concerns and the principle of least knowledge.
      If your functions and methods are short and specific with very few side effects, you can use Drop Frame with impunity most of the time.
      I use it a lot, because I often work on very large apps with complicated workflows that would require a lot of setup if I needed to get back to a certain state.

  • @yashjani99
    @yashjani99 2 ปีที่แล้ว +8

    This is such an underrated channel, i really enjoy your content 👌

  • @antonpripachkin5270
    @antonpripachkin5270 2 ปีที่แล้ว +15

    You missed a few points. Yes you can setup breakpoints with right click. But in case you want the program execution stop for a special condition, you can right click on existing breakpoint and type in condition. That way in case when breakpoint is, say, within a loop - you won't have to click over to reach expected condition and the program will stop only when that condition is met. Also you didn't mention execute code button - very handy. Basically you can execute some additional code in runtime, when reaching a breakpoint that is locally available in current breakpoint step

    • @mma-dost
      @mma-dost 9 หลายเดือนก่อน

      Thanks for the information.

  • @casaxtreme2952
    @casaxtreme2952 ปีที่แล้ว +1

    I hate you so much for not showing me this earlier ... :D
    Thank you for the tips, they are really helpful.

  • @azuolassaulius938
    @azuolassaulius938 2 ปีที่แล้ว +3

    Thanks for this great content. Finally the debugger tool doesn't look like a matrix terminal to me

  • @mkc0321
    @mkc0321 2 ปีที่แล้ว +1

    didn't knew most of these..thank you

  • @hossamqandel5303
    @hossamqandel5303 2 ปีที่แล้ว

    Your channel should be named
    Android developers charger 😂❤️❤️❤️❤️🇪🇬🇪🇬
    We need paging 3 tutorial plz ? ❤️

  • @alsh2887
    @alsh2887 2 ปีที่แล้ว +3

    Video is quite useful for beginners. But there were some points that were not shown, like adding expressions to variables, conditional breakpoints.

  • @oscarescam
    @oscarescam 2 ปีที่แล้ว

    which is your theme that you using in this video? is beatiful!

  • @exploringgodscountry
    @exploringgodscountry 6 หลายเดือนก่อน

    I cannot figure this out... I have a breakpoint on a Toast message that displays every time the code launches... Put additional breakpoints; on, before, and after. JUST to make sure I didn't do somethin stupid clicking wrong thing. I'm launching code using the debugger icon (not the run icon) just as in your tutorial. I see the debugger panel running at bottom of SDK. Then the Toast message displays but the breakpoint doesn't trip??? Is there a bug in the SDK? I'm super confused, I've used all kinds of debuggers but I have no clue what's going on here. For more details, I'm using the emulator not a external device / not USB debugging. Last note, I can click pause in the debugger panel then step to next line and it works... but it won't trip any breakpoints if I put them in the code. No clue.? There must be a bug no? Any idea how to submit a bug to Google?
    UPDATE: There seems to be an issue with the build files. I created a new project and debugger works. However, on this other project, I cannot figure out how to do a clean rebuild. In other SDK's that was pretty clear but here I don't know how to delete intermediate files and create a fresh build?

  • @b4ux1t3-tech
    @b4ux1t3-tech 2 ปีที่แล้ว +6

    Great video!
    Do you think that debugging asynchronous code could be its own video? I often run into an issue where I'm stepping through a suspend function, and the debugger just. . .runs off on its own, seemingly ignoring breakpoints.
    I know that this is due to the tricky nature of async, but it seems odd that I can't find any good info on configuring teh debugger to deal with async, especially given the IDE already highlights async calls with a special icon in the gutter.
    Some tips and tricks for debugging async kotlin would go a long way!

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +4

      Yeah it's tricky. I often actually prefer logs when debugging async stuff since with the timestamps you can better see what gets executed in which order. But very dependent on the situation

    • @chebbaelyes
      @chebbaelyes 2 ปีที่แล้ว +2

      I think if you open the breakpoints popup, you can select that you want to stop one thread or every thread when a breakpoint is reached.

    • @b4ux1t3-tech
      @b4ux1t3-tech 2 ปีที่แล้ว

      @@chebbaelyes that's a good tip. I need to check on that when I get back to work Tuesday!

  • @mohdotnet
    @mohdotnet ปีที่แล้ว

    New to android studing this video was super helpful.
    Can anyone kindly advise say I have an API in visual studio and my Android app in Android Studio how can I step into my visual code to debug the API when my Android app hits say a button click ?

  • @gokberkyagc4442
    @gokberkyagc4442 2 ปีที่แล้ว

    That is really helpful guide thanks. Also there is some kind of useful trick on Watches panel that you can manipulate data without rebuilding entire project for example you can change variable of array or swap's current value or something like that and the following code will be go with your manipulated variable.

  • @risslagrosa
    @risslagrosa 7 หลายเดือนก่อน

    Is there any chance to debugged a pre-built apks in android studio? If yes, this would be a great to learn. I have an app having an issue if installed on my device as pre-built. But it's working if I installed it directly from Android Studio. Hope you can help me

  • @yasserakbbach7342
    @yasserakbbach7342 2 ปีที่แล้ว

    I didn't know about the watches 👌👏

  • @original_anu
    @original_anu 2 ปีที่แล้ว

    You can click on line numbers to move to that line
    I need use watch variables more

  • @СергейСимоненко-р3к
    @СергейСимоненко-р3к ปีที่แล้ว

    Дякую друже, це найкраще відео про дебагер

  • @NHikmetK
    @NHikmetK 2 ปีที่แล้ว

    you missed the most important part that evaluate expressions you can use this icon for, such as you make request to a server and you have different any types of data and your request does not response success in this case you should check which data cause a problem in that poin you should comp related thing to EVALUATE EXPRESSION window and check what is the problem and what is the cause of the problem ;

  • @Marcix456
    @Marcix456 2 ปีที่แล้ว +1

    Great looking studio

  • @PimpMyYugioh
    @PimpMyYugioh 11 หลายเดือนก่อน

    Super useful, thank you!!

  • @johndominicjasmin
    @johndominicjasmin 2 ปีที่แล้ว

    You are saving my career. Thanks a lot man

  • @alphacoder3822
    @alphacoder3822 2 ปีที่แล้ว

    Bro you saving my ass for real. I'm new to Android

  • @mustafaammar551
    @mustafaammar551 2 ปีที่แล้ว +1

    Very cool video
    Thank you BRO👍👍👍

  • @md.tariqhasan8486
    @md.tariqhasan8486 2 ปีที่แล้ว

    Thanks for the video!
    Also, how do I enable the right panel showing all the code of the editor?

  • @AjayVerma-gu3uu
    @AjayVerma-gu3uu 2 ปีที่แล้ว

    Hey I have watched all your videos and recommend your channel to my colleague as well. This is superb what u are doing here.
    Can you give some idea regarding how to create a custom swipe refresh with lottie animations.
    Thanks in advance.

  • @pawankhandalnasirda
    @pawankhandalnasirda 2 ปีที่แล้ว

    Hi Philipp Lackner, Can make a video on Profiler.

  • @ritikmalhotra6252
    @ritikmalhotra6252 2 ปีที่แล้ว +1

    good videos now and then thanks✌️

  • @ahmetbiyik7392
    @ahmetbiyik7392 2 ปีที่แล้ว +1

    Make also a debugging video for professionals please

  • @chanakaranasinghe1968
    @chanakaranasinghe1968 ปีที่แล้ว

    very help full guid bro thanks 👍

  • @alonshlider4881
    @alonshlider4881 2 ปีที่แล้ว

    Please do an advances shortcuts video for Android Studio :)

  • @easybusinessou
    @easybusinessou 2 ปีที่แล้ว

    I am waiting for the videos day after day, can you explain the paginator,
    which you presented in a previous video, with the concept of Resources and Flow that you use in your projects

  • @spyro2008
    @spyro2008 ปีที่แล้ว

    Thank you a lot!!

  • @hk4545581
    @hk4545581 2 ปีที่แล้ว

    Can you create app tutorial videos for m1 or intel release NDK

  • @Ilamarea
    @Ilamarea 2 ปีที่แล้ว

    Is it possible to debug through the steps of loops?

  • @muazbhatti41
    @muazbhatti41 ปีที่แล้ว

    Thanks 👍

  • @bitwisedevs469
    @bitwisedevs469 2 ปีที่แล้ว

    I can't stress this enough

  • @glidingcoop7686
    @glidingcoop7686 10 หลายเดือนก่อน

    Philipp may not be pregnant by he never fails to deliver ❤

  • @phongnguyenphamthanh3106
    @phongnguyenphamthanh3106 8 หลายเดือนก่อน

    where can I find the debug console? plz help

    • @nastenkaoo
      @nastenkaoo 6 หลายเดือนก่อน

      open it from windows section

  • @hinrichwrage3004
    @hinrichwrage3004 2 ปีที่แล้ว

    Why Android Studio doesnt show me in which line my app crashed automatically by default?

  • @Talaria.School
    @Talaria.School 2 ปีที่แล้ว

    Phil u rock.

  • @freshtechtips
    @freshtechtips 2 ปีที่แล้ว

    I hope google will make a powerful development tools for android framework just like flutter

  • @brikka
    @brikka ปีที่แล้ว

    whats up with the braw bro? ;)

  • @mohyddineal-lahham7620
    @mohyddineal-lahham7620 2 ปีที่แล้ว

    Amazing

  • @aliciabeltran
    @aliciabeltran 2 ปีที่แล้ว

    What about suspended functions or flow

  • @andreass7012
    @andreass7012 2 ปีที่แล้ว

    Xcode theme 😍

  • @dzonassim
    @dzonassim 2 ปีที่แล้ว +1

    You have forgotten to mention how to catch an exception before it actually occurs via Java Exception Breakpoints. Still great job 👍

  • @yuruar
    @yuruar 2 ปีที่แล้ว +1

    Not really ultimate, but 👍

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      What's missing in your opinion? :)

    • @yuruar
      @yuruar 2 ปีที่แล้ว +1

      @@PhilippLackner I assumed that in this video there would be some complex techniques that I had not encountered before. But in fact, all this is familiar. Thanks for this video. (sorry for my language, I'm from Ukraine)

  • @TarekBuhdeima
    @TarekBuhdeima ปีที่แล้ว

    1K likes :)

  • @easybusinessou
    @easybusinessou 2 ปีที่แล้ว

    First View :)

    • @VipulThawreDev
      @VipulThawreDev 2 ปีที่แล้ว

      10th

    • @itszechs
      @itszechs 2 ปีที่แล้ว +4

      heh, View
      we use Compose now
      ...
      bad joke? 🥲

    • @easybusinessou
      @easybusinessou 2 ปีที่แล้ว +1

      @@itszechs nice developer's joke 🤩🥳🥳