bash – 如何在使用VSTS Shell脚本CI任务时生成后台进程
发布时间:2020-12-16 01:56:48 所属栏目:安全 来源:网络整理
导读:我正在尝试在CI过程中运行 androidTests.我为此使用VSTS构建定义.在测试之前,我必须启动 Android Emulator.我可以使用Shell脚本任务来启动模拟器,但由于我无法在后台启动该过程,因此构建流程无法继续下一步. 我已经尝试了下面列出的所有可能性: nohup $ANDR
我正在尝试在CI过程中运行
androidTests.我为此使用VSTS构建定义.在测试之前,我必须启动
Android Emulator.我可以使用Shell脚本任务来启动模拟器,但由于我无法在后台启动该过程,因此构建流程无法继续下一步.
我已经尝试了下面列出的所有可能性: nohup $ANDROID_HOME/tools/emulator @emulatorForUITests nohup $ANDROID_HOME/tools/emulator @emulatorForUITests & $ANDROID_HOME/tools/emulator @emulatorForUITests & 但模拟器仍然在前台运行.我做错了什么还是VSTS安全功能?如何在后台启动模拟器? 更新(回答评论中的问题): >在前景块中启动模拟器构建过程因此它 UPDATE2: (...) 2017-07-14T10:11:31.8195010Z emulator: WARNING: userdata partition is resized from 550 M to 800 M 2017-07-14T10:11:31.8202870Z 2017-07-14T10:11:31.8217150Z Hax is enabled 2017-07-14T10:11:31.8230410Z Hax ram_size 0x40000000 2017-07-14T10:11:31.8246000Z HAX is working and emulator runs in fast virt mode. 2017-07-14T10:11:34.0594360Z coreaudio: Could not initialize record - Unknown Audiodevice 2017-07-14T10:11:34.0627730Z coreaudio: Could not initialize record - Unknown Audiodevice 2017-07-14T10:11:34.0649440Z audio: Failed to create voice `goldfish_audio_in' 2017-07-14T10:11:34.0671380Z qemu-system-i386: warning: opening audio input failed 2017-07-14T10:11:34.0875870Z coreaudio: Could not initialize record - Unknown Audiodevice 2017-07-14T10:11:34.0888750Z coreaudio: Could not initialize record - Unknown Audiodevice 2017-07-14T10:11:34.0902400Z audio: Failed to create voice `adc' 2017-07-14T10:11:34.5066290Z emulator: emulator window was out of view and was recentered 2017-07-14T10:11:34.5078580Z 由于模拟器不是后台进程,因此VSTS等待模拟器进程完成. 解决方法
如果使用&运行命令,则可以在后台启动模拟器.并将输出发送到/ dev / null.我们做了一些试验和错误,它只有在我们输出输出时才有效,我猜测bash任务不知道它应该完成否则.
这是我们为启动模拟器而运行的一行示例: $ANDROID_HOME/tools/emulator -avd emulator &>/dev/null & (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |