如何在python中退出gdbserver?

2024-05-23 13:53:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我有以下gdbserver.sh脚本:

#!/usr/bin/env bash

adb shell "su -c 'gdbserver :1337 --attach 16352'"

使用pythong脚本,我想执行bash脚本,但是我很难退出;它只是暂停和输出:

Attached; pid = 16352

Listening on port 1337

python脚本是:

with Popen("Bash/gdbserver.sh",stdout=PIPE,stderr=PIPE,shell=True) as proc:
    output,err = proc.communicate()
    kill(int(pid), SIGINT)

我怎样才能捕捉输出是“附加。。。听着……“我怎么能放弃呢


Tags: env脚本bashbinusrshprocshell