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.

#98 (comment)
  • Loading branch information
consp1racy committed Jun 27, 2022
1 parent a82a1d8 commit ed9617e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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 @@ -166,7 +167,11 @@ execute_server(struct sc_server *server,
cmd[count++] = "-s";
cmd[count++] = serial;
cmd[count++] = "shell";
cmd[count++] = "mkdir -p";
cmd[count++] = SC_DEVICE_ANDROID_DATA_PATH "/dalvik-cache";
cmd[count++] = "&&";
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 ed9617e

Please sign in to comment.