.. | ||
scripts | ||
src | ||
.gitignore | ||
.npmignore | ||
jest.config.js | ||
LICENSE | ||
package.json | ||
README.md | ||
scrcpy.LICENSE | ||
tsconfig.json |
@yume-chan/scrcpy
TypeScript implementation of Scrcpy client.
It uses the official Scrcpy server releases.
WARNING: The public API is UNSTABLE. If you have any questions, please open an issue.
Download Server Binary
This package has a script fetch-scrcpy-server
to help you download the official server binary.
The server binary is subject to Apache License 2.0.
Usage:
$ npx fetch-scrcpy-server <version>
For example:
$ npx fetch-scrcpy-server 1.21
You can also add it to the postinstall
script of your package.json
so it will run automatically when you do npm install
:
"scripts": {
"postinstall": "fetch-scrcpy-server 1.21",
},
It will download the binary to bin/scrcpy
and write the version string to bin/version.js
. You can import the version string with
import SCRCPY_SERVER_VERSION from '@yume-chan/scrcpy/bin/version';
And import the server binary with file-loader (Webpack 4) or Asset Modules (Webpack 5).
Option versions
Scrcpy server has no backward compatibility on options input format. Currently the following versions are supported:
versions | type |
---|---|
1.16~1.17 | ScrcpyOptions1_16 |
1.18~1.20 | ScrcpyOptions1_18 |
1.21 | ScrcpyOptions1_21 |
You must use the correct type according to the server version.