From e7ea28bf5d5c3b9b555beca087b856e3536dde1f Mon Sep 17 00:00:00 2001 From: lisai9093 Date: Thu, 25 Jul 2024 11:41:32 -0700 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81MuMu=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E5=99=A8=E5=A4=9A=E5=BC=80=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/action.py b/action.py index 3293836..192c3df 100755 --- a/action.py +++ b/action.py @@ -14,7 +14,21 @@ def startup(): elif os.path.isfile(mumu_path): print('检测到MuMu模拟器') adb_path=mumu_path - comm=[adb_path,'connect','127.0.0.1:7555'] + #选择模拟器端口 + while True: + try: + raw=input('选择MuMu模拟器端口(直接回车使用默认7555):') + port=int(raw) + except ValueError: + if len(raw)==0: + port=7555 + break + print('请输入数字') + continue + else: + break + mumu_ip='127.0.0.1:'+str(port) + comm=[adb_path,'connect',mumu_ip] out=subprocess.run(comm,shell=False,capture_output=True,check=False) out=out.stdout.decode('utf-8') print(out)