Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
baa10ed0a3 | |||
2ed2247e8f | |||
5febb1e9fb | |||
5c3626ed47 | |||
0e473eb005 | |||
b26b4fb745 | |||
9555d3a537 |
@ -2,7 +2,7 @@
|
|||||||
source for the project. Do not download releases from random websites, even if
|
source for the project. Do not download releases from random websites, even if
|
||||||
their name contains `scrcpy`.**
|
their name contains `scrcpy`.**
|
||||||
|
|
||||||
# scrcpy (v3.0)
|
# scrcpy (v3.0.2)
|
||||||
|
|
||||||
<img src="app/data/icon.svg" width="128" height="128" alt="scrcpy" align="right" />
|
<img src="app/data/icon.svg" width="128" height="128" alt="scrcpy" align="right" />
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Romain Vimont, Genymobile"
|
VALUE "LegalCopyright", "Romain Vimont, Genymobile"
|
||||||
VALUE "OriginalFilename", "scrcpy.exe"
|
VALUE "OriginalFilename", "scrcpy.exe"
|
||||||
VALUE "ProductName", "scrcpy"
|
VALUE "ProductName", "scrcpy"
|
||||||
VALUE "ProductVersion", "3.0"
|
VALUE "ProductVersion", "3.0.2"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -518,13 +518,15 @@ Enable "show touches" on start, restore the initial value on exit.
|
|||||||
It only shows physical touches (not clicks from scrcpy).
|
It only shows physical touches (not clicks from scrcpy).
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-tcpip\fR[=\fIip\fR[:\fIport\fR]]
|
.BI "\-\-tcpip\fR[=[+]\fIip\fR[:\fIport\fR]]
|
||||||
Configure and reconnect the device over TCP/IP.
|
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 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.
|
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
|
.TP
|
||||||
.BI "\-\-time\-limit " seconds
|
.BI "\-\-time\-limit " seconds
|
||||||
Set the maximum mirroring time, in seconds.
|
Set the maximum mirroring time, in seconds.
|
||||||
|
@ -412,7 +412,7 @@ sc_adb_connect(struct sc_intr *intr, const char *ip_port, unsigned flags) {
|
|||||||
|
|
||||||
// "adb connect" always returns successfully (with exit code 0), even in
|
// "adb connect" always returns successfully (with exit code 0), even in
|
||||||
// case of failure. As a workaround, check if its output starts with
|
// case of failure. As a workaround, check if its output starts with
|
||||||
// "connected".
|
// "connected" or "already connected".
|
||||||
char buf[128];
|
char buf[128];
|
||||||
ssize_t r = sc_pipe_read_all_intr(intr, pid, pout, buf, sizeof(buf) - 1);
|
ssize_t r = sc_pipe_read_all_intr(intr, pid, pout, buf, sizeof(buf) - 1);
|
||||||
sc_pipe_close(pout);
|
sc_pipe_close(pout);
|
||||||
@ -429,7 +429,8 @@ sc_adb_connect(struct sc_intr *intr, const char *ip_port, unsigned flags) {
|
|||||||
assert((size_t) r < sizeof(buf));
|
assert((size_t) r < sizeof(buf));
|
||||||
buf[r] = '\0';
|
buf[r] = '\0';
|
||||||
|
|
||||||
ok = !strncmp("connected", buf, sizeof("connected") - 1);
|
ok = !strncmp("connected", buf, sizeof("connected") - 1)
|
||||||
|
|| !strncmp("already connected", buf, sizeof("already connected") - 1);
|
||||||
if (!ok && !(flags & SC_ADB_NO_STDERR)) {
|
if (!ok && !(flags & SC_ADB_NO_STDERR)) {
|
||||||
// "adb connect" also prints errors to stdout. Since we capture it,
|
// "adb connect" also prints errors to stdout. Since we capture it,
|
||||||
// re-print the error to stderr.
|
// re-print the error to stderr.
|
||||||
|
@ -860,16 +860,17 @@ static const struct sc_option options[] = {
|
|||||||
{
|
{
|
||||||
.longopt_id = OPT_TCPIP,
|
.longopt_id = OPT_TCPIP,
|
||||||
.longopt = "tcpip",
|
.longopt = "tcpip",
|
||||||
.argdesc = "ip[:port]",
|
.argdesc = "[+]ip[:port]",
|
||||||
.optional_arg = true,
|
.optional_arg = true,
|
||||||
.text = "Configure and reconnect the device over TCP/IP.\n"
|
.text = "Configure and connect the device over TCP/IP.\n"
|
||||||
"If a destination address is provided, then scrcpy connects to "
|
"If a destination address is provided, then scrcpy connects to "
|
||||||
"this address before starting. The device must listen on the "
|
"this address before starting. The device must listen on the "
|
||||||
"given TCP port (default is 5555).\n"
|
"given TCP port (default is 5555).\n"
|
||||||
"If no destination address is provided, then scrcpy attempts "
|
"If no destination address is provided, then scrcpy attempts "
|
||||||
"to find the IP address of the current device (typically "
|
"to find the IP address of the current device (typically "
|
||||||
"connected over USB), enables TCP/IP mode, then connects to "
|
"connected over USB), enables TCP/IP mode, then connects to "
|
||||||
"this address before starting.",
|
"this address before starting.\n"
|
||||||
|
"Prefix the address with a '+' to force a reconnection.",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.longopt_id = OPT_TIME_LIMIT,
|
.longopt_id = OPT_TIME_LIMIT,
|
||||||
|
@ -829,11 +829,14 @@ sc_server_switch_to_tcpip(struct sc_server *server, const char *serial) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
sc_server_connect_to_tcpip(struct sc_server *server, const char *ip_port) {
|
sc_server_connect_to_tcpip(struct sc_server *server, const char *ip_port,
|
||||||
|
bool disconnect) {
|
||||||
struct sc_intr *intr = &server->intr;
|
struct sc_intr *intr = &server->intr;
|
||||||
|
|
||||||
// Error expected if not connected, do not report any error
|
if (disconnect) {
|
||||||
sc_adb_disconnect(intr, ip_port, SC_ADB_SILENT);
|
// Error expected if not connected, do not report any error
|
||||||
|
sc_adb_disconnect(intr, ip_port, SC_ADB_SILENT);
|
||||||
|
}
|
||||||
|
|
||||||
LOGI("Connecting to %s...", ip_port);
|
LOGI("Connecting to %s...", ip_port);
|
||||||
|
|
||||||
@ -849,7 +852,7 @@ sc_server_connect_to_tcpip(struct sc_server *server, const char *ip_port) {
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
sc_server_configure_tcpip_known_address(struct sc_server *server,
|
sc_server_configure_tcpip_known_address(struct sc_server *server,
|
||||||
const char *addr) {
|
const char *addr, bool disconnect) {
|
||||||
// Append ":5555" if no port is present
|
// Append ":5555" if no port is present
|
||||||
bool contains_port = strchr(addr, ':');
|
bool contains_port = strchr(addr, ':');
|
||||||
char *ip_port = contains_port ? strdup(addr)
|
char *ip_port = contains_port ? strdup(addr)
|
||||||
@ -860,7 +863,7 @@ sc_server_configure_tcpip_known_address(struct sc_server *server,
|
|||||||
}
|
}
|
||||||
|
|
||||||
server->serial = ip_port;
|
server->serial = ip_port;
|
||||||
return sc_server_connect_to_tcpip(server, ip_port);
|
return sc_server_connect_to_tcpip(server, ip_port, disconnect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -885,7 +888,7 @@ sc_server_configure_tcpip_unknown_address(struct sc_server *server,
|
|||||||
}
|
}
|
||||||
|
|
||||||
server->serial = ip_port;
|
server->serial = ip_port;
|
||||||
return sc_server_connect_to_tcpip(server, ip_port);
|
return sc_server_connect_to_tcpip(server, ip_port, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -972,7 +975,13 @@ run_server(void *data) {
|
|||||||
sc_adb_device_destroy(&device);
|
sc_adb_device_destroy(&device);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ok = sc_server_configure_tcpip_known_address(server, params->tcpip_dst);
|
// If the user passed a '+' (--tcpip=+ip), then disconnect first
|
||||||
|
const char *tcpip_dst = params->tcpip_dst;
|
||||||
|
bool plus = tcpip_dst[0] == '+';
|
||||||
|
if (plus) {
|
||||||
|
++tcpip_dst;
|
||||||
|
}
|
||||||
|
ok = sc_server_configure_tcpip_known_address(server, tcpip_dst, plus);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
goto error_connection_failed;
|
goto error_connection_failed;
|
||||||
}
|
}
|
||||||
|
@ -233,10 +233,10 @@ install` must be run as root)._
|
|||||||
|
|
||||||
#### Option 2: Use prebuilt server
|
#### Option 2: Use prebuilt server
|
||||||
|
|
||||||
- [`scrcpy-server-v3.0`][direct-scrcpy-server]
|
- [`scrcpy-server-v3.0.2`][direct-scrcpy-server]
|
||||||
<sub>SHA-256: `800044c62a94d5fc16f5ab9c86d45b1050eae3eb436514d1b0d2fe2646b894ea`</sub>
|
<sub>SHA-256: `e19fe024bfa3367809494407ad6ca809a6f6e77dac95e99f85ba75144e0ba35d`</sub>
|
||||||
|
|
||||||
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-server-v3.0
|
[direct-scrcpy-server]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-server-v3.0.2
|
||||||
|
|
||||||
Download the prebuilt server somewhere, and specify its path during the Meson
|
Download the prebuilt server somewhere, and specify its path during the Meson
|
||||||
configuration:
|
configuration:
|
||||||
|
@ -85,6 +85,12 @@ scrcpy --tcpip=192.168.1.1 # default port is 5555
|
|||||||
scrcpy --tcpip=192.168.1.1:5555
|
scrcpy --tcpip=192.168.1.1:5555
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Prefix the address with a '+' to force a reconnection:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --tcpip=+192.168.1.1
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Manual
|
### Manual
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
Download a static build of the [latest release]:
|
Download a static build of the [latest release]:
|
||||||
|
|
||||||
- [`scrcpy-linux-v3.0.tar.gz`][direct-linux] (x86_64)
|
- [`scrcpy-linux-x86_64-v3.0.2.tar.gz`][direct-linux-x86_64] (x86_64)
|
||||||
<sub>SHA-256: `06cb74e22f758228c944cea048b78e42b2925c2affe2b5aca901cfd6a649e503`</sub>
|
<sub>SHA-256: `20b69dcd379bb7d7208bf1e4858cf04162fc856697be0e6c03863d7b3c1e734a`</sub>
|
||||||
|
|
||||||
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
||||||
[direct-linux]: https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-linux-v3.0.tar.gz
|
[direct-linux-x86_64]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-linux-x86_64-v3.0.2.tar.gz
|
||||||
|
|
||||||
and extract it.
|
and extract it.
|
||||||
|
|
||||||
|
10
doc/macos.md
10
doc/macos.md
@ -6,11 +6,15 @@
|
|||||||
|
|
||||||
Download a static build of the [latest release]:
|
Download a static build of the [latest release]:
|
||||||
|
|
||||||
- [`scrcpy-macos-v3.0.tar.gz`][direct-macos] (arm64)
|
- [`scrcpy-macos-aarch64-v3.0.2.tar.gz`][direct-macos-aarch64] (aarch64)
|
||||||
<sub>SHA-256: `5db9821918537eb3aaf0333cdd05baf85babdd851972d5f1b71f86da0530b4bf`</sub>
|
<sub>SHA-256: `811ba2f4e856146bdd161e24c3490d78efbec2339ca783fac791d041c0aecfb6`</sub>
|
||||||
|
|
||||||
|
- [`scrcpy-macos-x86_64-v3.0.2.tar.gz`][direct-macos-x86_64] (x86_64)
|
||||||
|
<sub>SHA-256: `8effff54dca3a3e46eaaec242771a13a7f81af2e18670b3d0d8ed6b461bb4f79`</sub>
|
||||||
|
|
||||||
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
||||||
[direct-macos]: https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-macos-v3.0.tar.gz
|
[direct-macos-aarch64]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-macos-aarch64-v3.0.2.tar.gz
|
||||||
|
[direct-macos-x86_64]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-macos-x86_64-v3.0.2.tar.gz
|
||||||
|
|
||||||
and extract it.
|
and extract it.
|
||||||
|
|
||||||
|
@ -15,8 +15,10 @@ scrcpy --new-display=/240 # use the main display size and 240 dpi
|
|||||||
|
|
||||||
On some devices, a launcher is available in the virtual display.
|
On some devices, a launcher is available in the virtual display.
|
||||||
|
|
||||||
When no launcher is available, the virtual display is empty. In that case, you
|
When no launcher is available (or if is explicitly disabled by
|
||||||
must [start an Android app](device.md#start-android-app).
|
[`--no-vd-system-decorations`](#system-decorations)), the virtual display is
|
||||||
|
empty. In that case, you must [start an Android
|
||||||
|
app](device.md#start-android-app).
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@ -24,12 +26,27 @@ For example:
|
|||||||
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
|
scrcpy --new-display=1920x1080 --start-app=org.videolan.vlc
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The app may itself be a launcher. For example, to run the open source [Fossify
|
||||||
|
Launcher]:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scrcpy --new-display=1920x1080 --no-vd-system-decorations --start-app=org.fossify.home
|
||||||
|
```
|
||||||
|
|
||||||
|
[Fossify Launcher]: https://f-droid.org/en/packages/org.fossify.home/
|
||||||
|
|
||||||
|
|
||||||
## System decorations
|
## System decorations
|
||||||
|
|
||||||
By default, virtual display system decorations are enabled. But some devices
|
By default, virtual display system decorations are enabled. To disable them, use
|
||||||
might display a broken UI;
|
`--no-vd-system-decorations`:
|
||||||
|
|
||||||
Use `--no-vd-system-decorations` to disable it.
|
```
|
||||||
|
scrcpy --new-display --no-vd-system-decorations
|
||||||
|
```
|
||||||
|
|
||||||
|
This is useful for some devices which might display a broken UI, or to disable
|
||||||
|
any default launcher UI available in virtual displays.
|
||||||
|
|
||||||
Note that if no app is started, no content will be rendered, so no video frame
|
Note that if no app is started, no content will be rendered, so no video frame
|
||||||
will be produced at all.
|
will be produced at all.
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
Download the [latest release]:
|
Download the [latest release]:
|
||||||
|
|
||||||
- [`scrcpy-win64-v3.0.zip`][direct-win64] (64-bit)
|
- [`scrcpy-win64-v3.0.2.zip`][direct-win64] (64-bit)
|
||||||
<sub>SHA-256: `dfbe8a8fef6535197acc506936bfd59d0aa0427e9b44fb2e5c550eae642f72be`</sub>
|
<sub>SHA-256: `f0de59f5d46127c87cd822d39d6665e016b86db4cd048101b262f6adb6766832`</sub>
|
||||||
- [`scrcpy-win32-v3.0.zip`][direct-win32] (32-bit)
|
- [`scrcpy-win32-v3.0.2.zip`][direct-win32] (32-bit)
|
||||||
<sub>SHA-256: `7cbf8d7a6ebfdca7b3b161e29a481c11088305f3e0a89d28e8e62f70c7bd0028`</sub>
|
<sub>SHA-256: `8db8d4984d642012c55802de71f507f8ff9f68a8cfed456d7a1982d47e065f64`</sub>
|
||||||
|
|
||||||
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
[latest release]: https://github.com/Genymobile/scrcpy/releases/latest
|
||||||
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-win64-v3.0.zip
|
[direct-win64]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-win64-v3.0.2.zip
|
||||||
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-win32-v3.0.zip
|
[direct-win32]: https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-win32-v3.0.2.zip
|
||||||
|
|
||||||
and extract it.
|
and extract it.
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
BUILDDIR=build-auto
|
BUILDDIR=build-auto
|
||||||
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v3.0/scrcpy-server-v3.0
|
PREBUILT_SERVER_URL=https://github.com/Genymobile/scrcpy/releases/download/v3.0.2/scrcpy-server-v3.0.2
|
||||||
PREBUILT_SERVER_SHA256=800044c62a94d5fc16f5ab9c86d45b1050eae3eb436514d1b0d2fe2646b894ea
|
PREBUILT_SERVER_SHA256=e19fe024bfa3367809494407ad6ca809a6f6e77dac95e99f85ba75144e0ba35d
|
||||||
|
|
||||||
echo "[scrcpy] Downloading prebuilt server..."
|
echo "[scrcpy] Downloading prebuilt server..."
|
||||||
wget "$PREBUILT_SERVER_URL" -O scrcpy-server
|
wget "$PREBUILT_SERVER_URL" -O scrcpy-server
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
project('scrcpy', 'c',
|
project('scrcpy', 'c',
|
||||||
version: '3.0',
|
version: '3.0.2',
|
||||||
meson_version: '>= 0.48',
|
meson_version: '>= 0.48',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
|
@ -7,8 +7,8 @@ android {
|
|||||||
applicationId "com.genymobile.scrcpy"
|
applicationId "com.genymobile.scrcpy"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 35
|
targetSdkVersion 35
|
||||||
versionCode 30000
|
versionCode 30002
|
||||||
versionName "3.0"
|
versionName "3.0.2"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRCPY_DEBUG=false
|
SCRCPY_DEBUG=false
|
||||||
SCRCPY_VERSION_NAME=3.0
|
SCRCPY_VERSION_NAME=3.0.2
|
||||||
|
|
||||||
PLATFORM=${ANDROID_PLATFORM:-35}
|
PLATFORM=${ANDROID_PLATFORM:-35}
|
||||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-35.0.0}
|
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-35.0.0}
|
||||||
|
@ -72,4 +72,8 @@ public final class IO {
|
|||||||
Throwable cause = e.getCause();
|
Throwable cause = e.getCause();
|
||||||
return cause instanceof ErrnoException && ((ErrnoException) cause).errno == OsConstants.EPIPE;
|
return cause instanceof ErrnoException && ((ErrnoException) cause).errno == OsConstants.EPIPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isBrokenPipe(Exception e) {
|
||||||
|
return e instanceof IOException && isBrokenPipe((IOException) e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,12 @@ public class SurfaceEncoder implements AsyncProcessor {
|
|||||||
// The capture might have been closed internally (for example if the camera is disconnected)
|
// The capture might have been closed internally (for example if the camera is disconnected)
|
||||||
alive = !stopped.get() && !capture.isClosed();
|
alive = !stopped.get() && !capture.isClosed();
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException | IllegalArgumentException e) {
|
} catch (IllegalStateException | IllegalArgumentException | IOException e) {
|
||||||
Ln.e("Encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
if (IO.isBrokenPipe(e)) {
|
||||||
|
// Do not retry on broken pipe, which is expected on close because the socket is closed by the client
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
Ln.e("Capture/encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
||||||
if (!prepareRetry(size)) {
|
if (!prepareRetry(size)) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user