Yes, It is completely undetectable to apps. Like whether they are getting run by a real human or getting automated.
(Automation via ADB sends device input actions (touch/tap/swipe) directly to the android OS (as if they are sent by the real touchscreen)
and Android OS passes those inputs to the app.
Just like how your (real human) touch/tap/swipe on the real touchscreen sends the input actions to the Android OS and then Android OS passes those input actions to the App.
So, for the app, both are exactly the same, as, it is only talking to Android OS.)
It is as safe as if you hire some person to do the exact same Actions.
But do note that even real humans will get action blocks if they do too many actions. So, just use the settings accodingly.