Fixed issue with blue stacks not launching locally on mac os with a l…#641
Draft
mattmcn9 wants to merge 2 commits intopyclashbot:masterfrom
Draft
Fixed issue with blue stacks not launching locally on mac os with a l…#641mattmcn9 wants to merge 2 commits intopyclashbot:masterfrom
mattmcn9 wants to merge 2 commits intopyclashbot:masterfrom
Conversation
martinmiglio
requested changes
Mar 2, 2026
| 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. |
Member
There was a problem hiding this comment.
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") |
Member
There was a problem hiding this comment.
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") |
Member
There was a problem hiding this comment.
Why return and not let raise? Do we handle this at the call site?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
WorkerProcess run()...and “Creating BlueStacks 5 emulator”, followed by no further emulator progress.