Skip to content

Fixed issue with blue stacks not launching locally on mac os with a l…#641

Draft
mattmcn9 wants to merge 2 commits intopyclashbot:masterfrom
mattmcn9:bluestack-not-launching-mac-os-local-build
Draft

Fixed issue with blue stacks not launching locally on mac os with a l…#641
mattmcn9 wants to merge 2 commits intopyclashbot:masterfrom
mattmcn9:bluestack-not-launching-mac-os-local-build

Conversation

@mattmcn9
Copy link
Copy Markdown
Contributor

@mattmcn9 mattmcn9 commented Mar 2, 2026

Summary

On macOS, starting the bot with BlueStacks selected would log “Creating BlueStacks 5 emulator” but BlueStacks never appeared to launch correctly. In reality, the process was getting stuck in ADB startup/connection logic before the emulator was usable. This change fixes the macOS startup path so BlueStacks and Clash Royale start reliably.

Root cause and symptoms

Observed symptoms:

  • Bot UI showed “Starting BlueStacks 5 emulator restart process…” but never progressed.
  • Terminal logs showed WorkerProcess run()... and “Creating BlueStacks 5 emulator”, followed by no further emulator progress.
  • When BlueStacks did appear, it often showed a black screen, and the UI would sometimes say Clash Royale was not installed, even though it was.

self.device_serial: str | None = None # "127.0.0.1:<port>"

self.adb_server_port: int = 5041
# On macOS, using a non-default ADB server port can leave `hd-adb` unresponsive.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you discover this issue with non-default port causing problems?

with suppress(Exception):
self.adb_server("kill-server") # Cause ADB loves to randomly fuck around
if is_macos():
self.adb_server("start-server")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a comment to explain why it's different

timeout=15,
)
except subprocess.TimeoutExpired:
return subprocess.CompletedProcess(args=args, returncode=124, stdout="", stderr="timeout")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return and not let raise? Do we handle this at the call site?

@mattmcn9 mattmcn9 marked this pull request as draft March 2, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants