Skip to content

Commit

Permalink
修复雷电模拟器分辨率
Browse files Browse the repository at this point in the history
  • Loading branch information
lisai9093 committed Dec 19, 2023
1 parent 0cb9462 commit f8cb46a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions action.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ def startup():
screen=screenshot([])
w=screen.shape[0]
h=screen.shape[1]
print('修改成桌面版分辨率')
if w>=h:
comm=[adb_path,"shell","wm","size","1136x640"]
subprocess.run(comm,shell=False)
elif w<h:
comm=[adb_path,"shell","wm","size","640x1136"]
subprocess.run(comm,shell=False)
print('原始分辨率:',w,'x',h)
if (w==640 and h==1136) or (h==640 and w==1136):
print('无需修改分辨率')
else:
print('修改成桌面版分辨率')
if w>=h:
comm=[adb_path,"shell","wm","size","1136x640"]
subprocess.run(comm,shell=False)
elif w<h:
comm=[adb_path,"shell","wm","size","640x1136"]
subprocess.run(comm,shell=False)
else:
print('未监测到ADB设备,默认使用桌面版')
adb_enable=False
Expand Down

0 comments on commit f8cb46a

Please sign in to comment.