【问题标题】:Start Appium in Background and save logs in a file without printing them in terminal在后台启动 Appium 并将日志保存在文件中而不在终端中打印它们
【发布时间】:2022-02-02 10:40:31
【问题描述】:

我有一个看起来像这样的 shell 脚本

set -o xtrace                     #traces commands before executing them
echo hello world
echo starting appium here in background
appium &
echo I have some other processes here 

我想在后台启动 appium 进程并将其日志打印到一个新文件中。当我运行脚本时,我不希望它们在控制台中可用。

我希望其他进程照常运行。

以下是我尝试过的命令:

appium &> appiumLogs.log
appium &> appiumLogs.log &
appium &>> appiumLogs.log &

但在所有情况下,appium 进程都在后台运行,但从未将日志保存在文件 appiumLogs 中。

【问题讨论】:

    标签: shell logging appium tee


    【解决方案1】:

    您可以为此使用 AppiumServiceBuilder。

    service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().. ...................... .withLogFile(new File("AppiumLog.text"))

    service.start();

    日志将保存在新文件中。

    【讨论】:

      猜你喜欢
      • 2017-07-07
      • 2018-06-06
      • 1970-01-01
      • 2021-12-22
      • 2012-04-10
      • 1970-01-01
      • 2020-10-28
      • 2017-06-16
      • 1970-01-01
      相关资源
      最近更新 更多