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

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 68

  • @SriHarshaChilakapati
    @SriHarshaChilakapati 2 года назад +40

    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 года назад +8

      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.

  • @antonpripachkin5270
    @antonpripachkin5270 2 года назад +16

    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 10 месяцев назад

      Thanks for the information.

  • @yashjani99
    @yashjani99 2 года назад +8

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

  • @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.

  • @azuolassaulius938
    @azuolassaulius938 2 года назад +3

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

  • @casaxtreme2952
    @casaxtreme2952 Год назад +1

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

  • @exploringgodscountry
    @exploringgodscountry 7 месяцев назад

    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?

  • @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 ? ❤️

  • @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 ;

  • @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!

  • @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

  • @oscarescam
    @oscarescam 2 года назад

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

  • @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.

  • @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

  • @ahmetbiyik7392
    @ahmetbiyik7392 2 года назад +1

    Make also a debugging video for professionals please

  • @alonshlider4881
    @alonshlider4881 2 года назад

    Please do an advances shortcuts video for Android Studio :)

  • @md.tariqhasan8486
    @md.tariqhasan8486 2 года назад

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

  • @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 ?

  • @pawankhandalnasirda
    @pawankhandalnasirda 2 года назад

    Hi Philipp Lackner, Can make a video on Profiler.

  • @original_anu
    @original_anu 2 года назад

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

  • @hinrichwrage3004
    @hinrichwrage3004 2 года назад

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

  • @СергейСимоненко-р3к

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

  • @johndominicjasmin
    @johndominicjasmin 2 года назад

    You are saving my career. Thanks a lot man

  • @yasserakbbach7342
    @yasserakbbach7342 2 года назад

    I didn't know about the watches 👌👏

  • @alphacoder3822
    @alphacoder3822 2 года назад

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

  • @glidingcoop7686
    @glidingcoop7686 10 месяцев назад

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

  • @PimpMyYugioh
    @PimpMyYugioh 11 месяцев назад

    Super useful, thank you!!

  • @hk4545581
    @hk4545581 2 года назад

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

  • @mustafaammar551
    @mustafaammar551 2 года назад +1

    Very cool video
    Thank you BRO👍👍👍

  • @freshtechtips
    @freshtechtips 2 года назад

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

  • @ritikmalhotra6252
    @ritikmalhotra6252 2 года назад +1

    good videos now and then thanks✌️

  • @chanakaranasinghe1968
    @chanakaranasinghe1968 Год назад

    very help full guid bro thanks 👍

  • @Ilamarea
    @Ilamarea 2 года назад

    Is it possible to debug through the steps of loops?

  • @Marcix456
    @Marcix456 2 года назад +1

    Great looking studio

  • @bitwisedevs469
    @bitwisedevs469 2 года назад

    I can't stress this enough

  • @brikka
    @brikka Год назад

    whats up with the braw bro? ;)

  • @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 👍

  • @phongnguyenphamthanh3106
    @phongnguyenphamthanh3106 8 месяцев назад

    where can I find the debug console? plz help

    • @nastenkaoo
      @nastenkaoo 7 месяцев назад

      open it from windows section

  • @spyro2008
    @spyro2008 Год назад

    Thank you a lot!!

  • @muazbhatti41
    @muazbhatti41 2 года назад

    Thanks 👍

  • @Talaria.School
    @Talaria.School 2 года назад

    Phil u rock.

  • @andreass7012
    @andreass7012 2 года назад

    Xcode theme 😍

  • @aliciabeltran
    @aliciabeltran 2 года назад

    What about suspended functions or flow

  • @mohyddineal-lahham7620
    @mohyddineal-lahham7620 2 года назад

    Amazing

  • @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 🤩🥳🥳