ya-webadb/libraries/scrcpy
2022-01-09 22:54:50 +08:00
..
scripts feat(scrcpy): support server v1.21 2021-12-23 14:24:58 +08:00
src chore: enable noImplicitOverride 2022-01-09 22:54:50 +08:00
.gitignore wip: add scrcpy module 2021-10-18 09:34:45 +08:00
.npmignore wip: add scrcpy module 2021-10-18 09:34:45 +08:00
jest.config.js wip: add scrcpy module 2021-10-18 09:34:45 +08:00
LICENSE wip: add scrcpy module 2021-10-18 09:34:45 +08:00
package.json chore: enable noImplicitOverride 2022-01-09 22:54:50 +08:00
README.md chore: set esmodule for node.js 2022-01-08 19:13:06 +08:00
scrcpy.LICENSE wip: add scrcpy module 2021-10-18 09:34:45 +08:00
tsconfig.json feat(scrcpy): support both 1.17 and 1.19 servers 2021-12-08 18:32:01 +08:00

@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.