Skip to content

Commit

Permalink
Override ANDROID_DATA in server
Browse files Browse the repository at this point in the history
We need a path that is writable by shell on Android 4.

Genymobile#98 (comment)
  • Loading branch information
consp1racy committed Jun 20, 2022
1 parent 921080a commit 10eac04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#define SC_SERVER_PATH_DEFAULT PREFIX "/share/scrcpy/" SC_SERVER_FILENAME
#define SC_DEVICE_SERVER_PATH "/data/local/tmp/scrcpy-server.jar"
#define SC_DEVICE_ANDROID_DATA_PATH "/data/local/tmp"

static char *
get_server_path(void) {
Expand Down Expand Up @@ -167,6 +168,7 @@ execute_server(struct sc_server *server,
cmd[count++] = serial;
cmd[count++] = "shell";
cmd[count++] = "CLASSPATH=" SC_DEVICE_SERVER_PATH;
cmd[count++] = "ANDROID_DATA=" SC_DEVICE_ANDROID_DATA_PATH;
cmd[count++] = "app_process";

#ifdef SERVER_DEBUGGER
Expand Down

0 comments on commit 10eac04

Please sign in to comment.