我想在 MAC 应用程序中使用 adb
命令
我能够在终端以及我的Shell 脚本中使用adb 命令。 我能够在我使用 Automator 创建的服务中使用相同的内容,甚至在 Applescripts 中也是如此。
我无法在使用 Automator 创建的任何应用程序中使用 adb 命令ONLY。我的应用有一个运行 shell 脚本的工作流。我无法在脚本中使用 adb devices
或 adb
;说意外错误
是关于在$PATH
中添加对adb
的永久引用。我只在 bash_rc
文件中执行此操作,这解释了为什么 shell 脚本(或打开终端的东西)成功运行 - 因为它们总是先调用 bash_rc
如果是这样,怎么做到的?
最佳答案
我做了以下并解决了问题:
export adb=path/to/adb
for f in "$@"
do
$adb devices
$adb do-something "$f"
done
# using adb devices; doesn't work as adb was not recognized,
# so I exported it from full path
# $@ are my files that I wont to run my script upon
关于android - 在 Mac 应用程序中使用 adb 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10636080/