Debug download file from Android client using Xdebug

I am using Android Client and nextcloud server. With the nextcloud android client I am trying to download a file from the server (since I want to modify the way the download takes place) and trace execution using Xdebug.

I am using Xdebug to debug all the requests from the Android Client to the server (installed in PHPSTORM), however, since there are lots of scripts to be executed before the actual download takes place (and I need to click Step Over on every instruction), the Android Client returns “server unavailable” because the download takes longer time than expected.

Do you have any idea who I can solve such issue? It is important for me to see what are the instructions that execute before Android Client start downloading the file, however, since the debugging takes sometime (and me click Step Over every time) the android client just return server unavailable error.

In general, how can I debug timely-critical operations where the delay in time might change the application behavior?