Skip to content

Commit 6c210c1

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 536bb6f commit 6c210c1

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

lib/LocalBinary.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ function LocalBinary(){
9393

9494
this.getBinaryFilename = function() {
9595
if(this.hostOS.match(/darwin|mac os/i)){
96-
return 'BrowserStackLocal-darwin-x64';
96+
if(this.isArm64) {
97+
return 'BrowserStackLocal-darwin-arm64';
98+
} else {
99+
return 'BrowserStackLocal-darwin-x64';
100+
}
97101
} else if(this.hostOS.match(/mswin|msys|mingw|cygwin|bccwin|wince|emc|win32/i)) {
98102
this.windows = true;
99103
return 'BrowserStackLocal.exe';

test/local.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,19 @@ describe('LocalBinary', function () {
393393
it('should return darwin binary filename', function() {
394394
['darwin', 'mac os'].forEach(function(os) {
395395
localBinary.hostOS = os;
396+
localBinary.isArm64 = false;
396397
expect(localBinary.getBinaryFilename()).to.equal('BrowserStackLocal-darwin-x64');
397398
});
398399
});
399400

401+
it('should return darwin arm64 binary filename', function() {
402+
['darwin', 'mac os'].forEach(function(os) {
403+
localBinary.hostOS = os;
404+
localBinary.isArm64 = true;
405+
expect(localBinary.getBinaryFilename()).to.equal('BrowserStackLocal-darwin-arm64');
406+
});
407+
});
408+
400409
it('should return exe binary filename', function() {
401410
['mswin', 'msys', 'mingw', 'cygwin', 'bccwin', 'wince', 'emc', 'win32'].forEach(function(os) {
402411
localBinary.hostOS = os;

0 commit comments

Comments
 (0)