Skip to content

Commit

Permalink
Merge pull request #134 from pur1fying/adb_ip_dev
Browse files Browse the repository at this point in the history
Feat: Custom ADB IP Setting Support
  • Loading branch information
pur1fying authored Aug 17, 2024
2 parents 450b666 + f53db24 commit 1d8ff10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/Baas_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,13 @@ def _init_emulator(self) -> bool:
self.logger.error("Emulator start failed")
return False
try:
self.adb_ip = self.config.get('adbIP')
self.adb_port = self.config.get('adbPort')
self.logger.info("adb port: " + str(self.adb_port))
self.logger.info(f"adb Address: {self.adb_ip}:{str(self.adb_port)}")
if not self.adb_port or self.adb_port == '0':
self.connection = u2.connect()
else:
self.connection = u2.connect(f'127.0.0.1:{self.adb_port}')
self.connection = u2.connect(f'{self.adb_ip}:{self.adb_port}')
# self.check_atx_agent_cache()
self.check_atx()
self.first_start_u2 = False
Expand Down
1 change: 1 addition & 0 deletions core/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
"爱丽丝(女仆)"
],
"server": "官服",
"adbIP": "127.0.0.1",
"adbPort": "5555",
"lesson_times": [
1,
Expand Down
5 changes: 5 additions & 0 deletions gui/components/expand/serverConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def __init__(self, parent=None, config=None):
'key': 'server',
'selection': [ServerConfig.tr('官服'), ServerConfig.tr('B服'), ServerConfig.tr('国际服'), ServerConfig.tr('国际服青少年'), ServerConfig.tr('韩国ONE'), ServerConfig.tr('日服')]
},
{
'label': ServerConfig.tr('请填写您adb的IP地址'),
'type': 'text',
'key': 'adbIP'
},
{
'label': ServerConfig.tr('请填写您的adb端口号'),
'type': 'text',
Expand Down

0 comments on commit 1d8ff10

Please sign in to comment.