Because I work on a laptop, I was experimenting with different wireless adb apks for Android, having a cable under my hand isn’t too handy. After a few tests I started getting that error:
com.android.ddmlib.InstallException: Unknown failure (/system/bin/sh: pm: can't execute: Permission denied)
Didn’t tell me much. I started Googling… No results. Ok, one result… taking me to Gitlab-CI of my project. So I had this before. I didn’t solve it, don’t know why. Probably because it was when I was experimenting with different ROMs on my another device. So I “fixed” it by reinstalling ROM, and it came back.
Not many things where helpful online so I had to find solution myself and here I present it to you, and to future me, when I have this again.