How to run a adb shell command in connected android device?

I am trying to run an ADB command to enter passcode using Appium with python but once I run my code I can see the keypad is getting opened but can’t see the number getting entered and done button is clicked

The command I am trying to run is adb shell input text 0000 this works fine when I run this via terminal in mac. But on running it via pycharm using the following code there is no action done in mobile and also there is no error in logs or console

Python code is
driver.execute_script(‘mobile: shell’, {
‘command’: ‘input’,
‘args’: [‘text’, ‘0000’]
‘includeStderr’: True,
‘timeout’: 5000
})
driver.execute_script(‘mobile: shell’, {
‘command’: ‘input’,
‘args’: [‘keyevent’, ‘66’],
‘includeStderr’: True,
‘timeout’: 5000
})

You could try https://github.com/appium/appium-uiautomator2-driver#mobile-unlock to unlock the device if you use UIA2 driver

Actually, I want to send this to unlock an app protected by biometrics. As we can’t automate biometrics I try to send unlock code so it can use the PIN to unlock the app