android – 如何从root设备中的shell脚本将stdout重定向到logcat?

android – 如何从root设备中的shell脚本将stdout重定向到logcat?,第1张

概述我在root用户设备中运行 shell脚本,我试图通过跟踪 shell脚本生成的stdout输出(通过命令或echo)来调试它.是否可以通过将stdout重定向到logcat来实现? 在 Android Shell脚本中,使用以下命令: log -p v -t "test" "test script message" 然后,您将在Androids Logcat中看到您的消息: adb logca 我在root用户设备中运行 shell脚本,我试图通过跟踪 shell脚本生成的stdout输出(通过命令或echo)来调试它.是否可以通过将stdout重定向到logcat来实现?解决方法 在 Android Shell脚本中,使用以下命令:

log -p v -t "test"  "test script message"

然后,您将在AndroIDs Logcat中看到您的消息:

adb logcat | grep test

用法:

log [-p priorityChar] [-t tag] message    priorityChar should be one of:        v,d,i,w,e

这适用于DroID 4.4.3

总结

以上是内存溢出为你收集整理的android – 如何从root设备中的shell脚本将stdout重定向到logcat?全部内容,希望文章能够帮你解决android – 如何从root设备中的shell脚本将stdout重定向到logcat?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1128911.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存