2012-05-17 42 views
2

利用亚行命令我想在Mac应用程序在Mac应用程序

使用adb命令我能够终端使用ADB命令,在我Shell脚本为好。 我使用相同的服务,我用Automator创建,即使在Applescripts

我无法在任何使用Automator创建的应用程序中使用adb命令仅限。我的应用程序有一个运行shell脚本的工作流程。我无法在剧本中使用adb devicesadb; 意外错误

难道是关于在$PATH中添加对adb的永久引用。我只在bash_rc文件中这样做,这解释了为什么shell脚本(或打开终端的东西)成功运行 - 因为他们始终呼叫bash_rc第一个

如果是这样,那么执行该操作的方式是什么?

+1

你可以尝试通过一个完整的显式路径运行ADB,从发现在终端 –

+0

“亚行”这可能是一个更容易诊断,如果您发布了实际的shell脚本和实例错误消息。 – kopischke

+0

@kopischke - 抱歉这么晚... 1.关于实际的错误信息,它说'adb:command not found'。 2.关于脚本,我有一个自动化工作流程,说Run Shell Script - 'adb devices; adb install -r“$ f”',其中'$ f'是应用程序打开的文件列表。我能够运行其他命令,例如,将文件路径放到一个txt文件以及大多数SH内容中 –

回答

1

我做了以下内容,并解决了这个问题:

export adb=path/to/adb 

for f in "[email protected]" 
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 

# [email protected] are my files that I wont to run my script upon