I am trying to do some auto testing and I need to trigger a long press of a key using adb command from my PC. For example, a long press home button would bring up the lates used apps. I found that key event #3 is for home key. But I could not figure out how to trigger a long press of the home button. Some post here suggest using sleep command. But it does not work for me, it always trigger the single click event and then go to sleep. It is not doing a long press action. Please help.
What I tried is: adb shell input keyevent 3 adb shell sleep 2
I am just using home key as an example. It can be any key on an Android device, for example, the dpad key. back key, etc.