android - 在 adb shell 非交互模式下有别名

标签 android unix sh adb mksh

您好,我需要以 adb shell <command> 的形式运行

当我在 adb shell 中测试所有内容时,它起作用了,因为我能够在 .bashrc 中设置一些别名。 . 然而,当我做 adb shell <command> , 没有任何效果因为 .bashrc运行时不使用 adb shell <command> ,因为它处于非交互模式。

我该如何解决这个问题?我可以adb push一些文件到文件系统,以便在 adb shell 时别名将在那里运行了吗?

最佳答案

如果您的 android 设备已获得 root 权限,您可以将 adb shell 的别名添加到 /system/etc/mkshrc 文件中。

关于android - 在 adb shell 非交互模式下有别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26288222/

相关文章:

linux - cd 到 unix 中的目录是否需要执行权限?

linux - awk - solaris 中的反引号以接受命令行 arg

c++ - 在python脚本中加载.so文件时出现 undefined symbol 错误

bash - 超时执行持续时间而不是命令

linux - 如何在不使用json工具和JQ工具的情况下在shell脚本中读取和解析JSON

android - 为什么我的按钮将 "colorPrimary"作为默认背景颜色?

android - 在 Android 的对话框中获取从动态创建的 edittext 输入的整数值会抛出 NumberFormatException

java - 在 Android 中将字符串转换为 Java 源代码

java - 安卓,改造 2 : How to make calls every 5 second?

python - 通过 sh 模块运行 python 脚本后访问 stderr