Is there a way to screenrecord while App is running?

There is a adb command : “adb shell screenrecord %directory%/aaa.mp4”

String cmd = "adb shell screenrecord /sdcard/demo.mp4"


but it records only for 3 minutes so i’m going to execute the command before all testcases.

=== Problem ===

Problem is when i exec that command, then error occurs

the error is

Root cause: org.openqa.selenium.WebDriverException: Connection reset```

It seems after executing a **adb** command, connection error occurs.

Isn't there any way to 
1) record while katalon auto test is running
2) execute "adb command" while katalon auto test is running with no error