I am trying to perform adb interactions through python code. I have an endless executable on the android device which i would like to start and after 10 seconds kill it. right now, i can get the program to start but cannot kill it other the manually pressing ctrl+c.
procID = subprocess.Popen(["adb", "shell"], stdin=subprocess.PIPE,)
procID.communicate('su\n endless_program data/test 5\n')
time.sleep(5)
os.kill(procID, signal.SIGINT)
procID.kill()
i tried killing it with os.kill or procID.kill but both don't seem to work.
I have also trying using pexpect, but for some reason i cant get it to run adb.