There exists an incompatibility problem as the shell command "ps comm" is invalid in some devices such as Google Pixel.
Below is the output when I issued "ps com" in Pixel:
1|sailfish:/ $ ps com
bad pid 'com'
1|sailfish:/ $ echo $?
1
So I replaced "ps comm" with "ps" which is workable for all the Android device.