Skip to content

Commit af31327

Browse files
vivianludrickclaude
andcommitted
LOC-7291: download darwin-arm64 binary on Apple Silicon
On macOS the binding now selects BrowserStackLocal-darwin-arm64 when the runtime reports arm64 (same runtime-arch detection the linux-arm64 path already uses); x64 runtimes (including x64-under-Rosetta) keep BrowserStackLocal-darwin-x64, preserving current behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6a67875 commit af31327

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

lib/browserstack/localbinary.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ def compute_binary_filename
5555
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
5656
'BrowserStackLocal.exe'
5757
when /darwin|mac os/
58-
'BrowserStackLocal-darwin-x64'
58+
if host_cpu =~ /arm64|aarch64/
59+
'BrowserStackLocal-darwin-arm64'
60+
else
61+
'BrowserStackLocal-darwin-x64'
62+
end
5963
when /linux/
6064
if host_cpu =~ /arm64|aarch64/
6165
'BrowserStackLocal-linux-arm64'

test/browserstack-local-test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,16 @@ def test_alpine_x64_picks_alpine_binary
141141
end
142142
end
143143

144-
def test_darwin_arm64_picks_darwin_x64
145-
# No darwin-arm64 binary; runs under Rosetta. Matches Node.
144+
def test_darwin_arm64_picks_darwin_arm64
146145
with_host_config('darwin22', 'arm64') do
146+
assert_equal 'BrowserStackLocal-darwin-arm64',
147+
BrowserStack::LocalBinary.new.send(:compute_binary_filename)
148+
end
149+
end
150+
151+
def test_darwin_x64_picks_darwin_x64
152+
# x64 runtime (including x64-under-Rosetta) keeps the x64 binary
153+
with_host_config('darwin22', 'x86_64') do
147154
assert_equal 'BrowserStackLocal-darwin-x64',
148155
BrowserStack::LocalBinary.new.send(:compute_binary_filename)
149156
end

0 commit comments

Comments
 (0)