我需要在以下内容上提供帮助:
我使用Linux来编写命令并发送到设备。我需要向设备提交一个grep logcat命令,然后迭代它的输出,当正在生成的输出中查找特定字符串时。一旦找到这个字符串,我希望我的脚本移动到下一个命令。
伪代码如下:
for line in "adb shell logcat | grep TestProccess"
do
if "TestProccess test service stopped" in line:
print line
print "TestService finished \n"
break
else:
print line
done