是否可以通过我的Andr​​oid应用程序来执行的adb命令吗? [英] Is it possible to execute adb commands through my android app?

查看:120
本文介绍了是否可以通过我的Andr​​oid应用程序来执行的adb命令吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以说,无论是亚行的命令可以通过我的Andr​​oid应用程序来执行。如果能够执行,它是如何实现的?

Can anyone say, whether adb commands can be executed through my android application. If it is possible to execute, how it can be implemented?

任何帮助吗?鸭preciated ...

Any Help ? Appreciated ...

推荐答案

您可以用这个做到这一点:

Process process = Runtime.getRuntime().exec("your command");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));

不要忘了用try和catch语句包围它。

Don't forget to surround it with a try and catch statement.

编辑:

@Phix是正确的,的ProcessBuilder 会更好用

@Phix is right, ProcessBuilder would be better to use.

这篇关于是否可以通过我的Andr​​oid应用程序来执行的adb命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆