Skip to content

Commit

Permalink
perf: 🚀 Update to scrcpy v3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Dec 5, 2024
1 parent 0e098c3 commit 7510548
Show file tree
Hide file tree
Showing 21 changed files with 858 additions and 18 deletions.
26 changes: 12 additions & 14 deletions electron/configs/scrcpy/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { extraResolve } from '$electron/helpers/index.js'
import { archResolve, extraResolve } from '$electron/helpers/index.js'
import which from 'which'

export const getScrcpyPath = () => {
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`)
}
}
else if (['linux'].includes(process.platform)) {
return extraResolve('linux/scrcpy/scrcpy')
}
export function getScrcpyPath() {
switch (process.platform) {
case 'win32':
return extraResolve(archResolve('win#{arch}/scrcpy/scrcpy.exe'))
case 'darwin':
return extraResolve(archResolve('mac#{arch}/scrcpy/scrcpy'))
case 'linux':
return extraResolve(archResolve('linux#{arch}/scrcpy/scrcpy'))

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

export const scrcpyPath = getScrcpyPath()
7 changes: 7 additions & 0 deletions electron/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,10 @@ export function loadPage(win, prefix = '') {
win.loadFile(join(process.env.DIST, prefix, 'index.html'))
}
}

export function archResolve(filePath = '', { template = '#{arch}', defaultArch = 'x64' } = {}) {
const arch = ![defaultArch].includes(process.arch) ? `-${process.arch}` : ''

const value = filePath.replaceAll(template, arch)
return value
}
Binary file modified electron/resources/extra/linux/scrcpy/scrcpy
Binary file not shown.
Binary file modified electron/resources/extra/linux/scrcpy/scrcpy-server
Binary file not shown.
6 changes: 4 additions & 2 deletions electron/resources/extra/linux/scrcpy/scrcpy.1
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,15 @@ Enable "show touches" on start, restore the initial value on exit.
It only shows physical touches (not clicks from scrcpy).

.TP
.BI "\-\-tcpip\fR[=\fIip\fR[:\fIport\fR]]
Configure and reconnect the device over TCP/IP.
.BI "\-\-tcpip\fR[=[+]\fIip\fR[:\fIport\fR]]
Configure and connect the device over TCP/IP.

If a destination address is provided, then scrcpy connects to this address before starting. The device must listen on the given TCP port (default is 5555).

If no destination address is provided, then scrcpy attempts to find the IP address and adb port of the current device (typically connected over USB), enables TCP/IP mode if necessary, then connects to this address before starting.

Prefix the address with a '+' to force a reconnection.

.TP
.BI "\-\-time\-limit " seconds
Set the maximum mirroring time, in seconds.
Expand Down
Binary file removed electron/resources/extra/linux/scrcpy/scrcpy_bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 7510548

Please sign in to comment.