Java Program that runs commands with Linux Terminal

前端 未结 2 1288
逝去的感伤
逝去的感伤 2020-12-22 02:58

My question is this, I am running some adb commands through the terminal. I wrote a tool; that will help make things easier. So back to the question, in order to make the co

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 03:57

    Child process I/O can be redirected, using Process class. You should be able to monitor the output & provide input (the password) into the child process.

    See:

    • http://docs.oracle.com/javase/7/docs/api/java/lang/Process.html
    • http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html

提交回复
热议问题