简体   繁体   English

如何在Android中使用ADB Shell命令?

[英]How can I use adb shell command in android?

I want use adb shell cammand in android. 我想在android中使用adb shell cammand。 My goal is show "adb shell pm list packages -f" result on android( just print that result ) 我的目标是在android上显示“ adb shell pm列表软件包-f”结果 (只打印该结果)

I think it is only one solution.. is there any other solution on my problem? 我认为这只是一个解决方案。.我的问题还有其他解决方案吗?

I want just print that result( packages list )..! 我只想打印结果(包列表)..!

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

try this one , Hope this will helps you ! 试试这个,希望对您有帮助! cheers ! 欢呼!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM