Skip to content

Commit

Permalink
fix: 🐛 Fix for built-in scrcpy not supporting x64 macos
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 26, 2024
1 parent cb2efef commit 0d60655
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions electron/configs/scrcpy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { extraResolve } from '$electron/helpers/index.js'
import which from 'which'

export const getScrcpyPath = () => {
switch (process.platform) {
case 'win32':
return extraResolve('win/scrcpy/scrcpy.exe')
case 'darwin':
if (['win32'].includes(process.platform)) {
return extraResolve('win/scrcpy/scrcpy.exe')
}
else if (['darwin'].includes(process.platform)) {
if (['arm64'].includes(process.arch)) {
return extraResolve(`mac/scrcpy/scrcpy`)
case 'linux':
return extraResolve('linux/scrcpy/scrcpy')
default:
return which.sync('scrcpy', { nothrow: true })
}
}
else if (['linux'].includes(process.platform)) {
return extraResolve('linux/scrcpy/scrcpy')
}

return which.sync('scrcpy', { nothrow: true })
}

export const scrcpyPath = getScrcpyPath()

0 comments on commit 0d60655

Please sign in to comment.