Skip to content

Commit

Permalink
fix #209
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Aug 25, 2023
1 parent f5aa775 commit e084978
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion solox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from __future__ import absolute_import

__version__ = '2.7.3'
__version__ = '2.7.4'
19 changes: 10 additions & 9 deletions solox/public/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import time
import requests
from logzero import logger
from solox.public.adb import adb
from tqdm import tqdm
import socket
from urllib.request import urlopen
Expand All @@ -19,6 +18,8 @@
from jinja2 import Environment, FileSystemLoader
from tidevice._device import Device
from tidevice import Usbmux
from solox.public.adb import adb


class Platform:
Android = 'Android'
Expand Down Expand Up @@ -53,7 +54,7 @@ def getDeviceIds(self):
Ids = list(os.popen(f"{self.adb} devices").readlines())
deviceIds = []
for i in range(1, len(Ids) - 1):
id, state = Ids[i].strip().split('\t')
id, state = Ids[i].strip().split()
if state == 'device':
deviceIds.append(id)
return deviceIds
Expand Down Expand Up @@ -172,14 +173,14 @@ def getDdeviceDetail(self, deviceId, platform):
result['serialno'] = adb.shell(cmd='getprop ro.serialno', deviceId=deviceId)
cmd = f'ip addr show wlan0 | {self.filterType()} link/ether'
wifiadr_content = adb.shell(cmd=cmd, deviceId=deviceId)
result['wifiadr'] = Method._index(wifiadr_content.split(' '), 1, '')
result['wifiadr'] = Method._index(wifiadr_content.split(), 1, '')
case Platform.iOS:
iosInfo = json.loads(self.execCmd('tidevice info --json'))
result['brand'] = iosInfo['DeviceClass']
result['name'] = iosInfo['DeviceName']
result['version'] = iosInfo['ProductVersion']
result['serialno'] = iosInfo['SerialNumber']
result['wifiadr'] = iosInfo['WiFiAddress']
ios_device = Device(udid=deviceId)
result['brand'] = ios_device.get_value("DeviceClass", no_session=True)
result['name'] = ios_device.get_value("DeviceName", no_session=True)
result['version'] = ios_device.get_value("ProductVersion", no_session=True)
result['serialno'] = ios_device.get_value("SerialNumber", no_session=True)
result['wifiadr'] = ios_device.get_value("WiFiAddress", no_session=True)
case _:
raise Exception('{} is undefined'.format(platform))
return result
Expand Down
2 changes: 1 addition & 1 deletion solox/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2 class="page-title">
</li>
<li class="list-inline-item">
<a href="https://github.com/smart-test-ti/SoloX/releases" target="_blank" class="link-secondary" rel="noopener">
{% if lan == 'cn' %} 版本 {% else %} Releases {% endif %} . V2.7.3
{% if lan == 'cn' %} 版本 {% else %} Releases {% endif %} . V2.7.4
</a>
</li>
</ul>
Expand Down

0 comments on commit e084978

Please sign in to comment.