Skip to content

Commit

Permalink
Update Baas_thread.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pur1fying committed Jul 19, 2024
1 parent 655dfd8 commit ef96c56
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions core/Baas_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ def _init_emulator(self) -> bool:
try:
self.adb_port = self.config.get('adbPort')
self.logger.info("adb port: " + str(self.adb_port))
self.check_atx_agent_cache()
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.check_atx_agent_cache()
self.check_atx()
self.first_start_u2 = False
self.last_refresh_u2_time = time.time()
Expand All @@ -308,17 +308,9 @@ def _init_emulator(self) -> bool:
return False

def check_atx_agent_cache(self):
self.logger.info("--------------Check ATX Agent Cache----------------")
dire = "C:\\Users\\pc\\.uiautomator2\\cache\\atx-agent_0.10.0_linux_386.tar.gz-1f8cdf3239"
if os.path.exists(dire + "\\atx-agent"):
return
self.logger.info("atx-agent cache [ atx-agent ] not found in path [ " + dire + " ]")
if not os.path.exists(dire):
self.logger.info("make dir [ " + dire + " ]")
os.makedirs(dire)
if not os.path.exists(dire + "\\atx-agent"):
self.logger.info("copy atx-agent to [ " + dire + " ]")
shutil.copy("src/atx_app/atx-agent", dire + "\\atx-agent")
init = u2.Initer(self.connection._adb_device)
path = u2.init.gen_cachepath(init.atx_agent_url)


def check_atx(self):
self.logger.info("--------------Check ATX install ----------------")
Expand Down

0 comments on commit ef96c56

Please sign in to comment.