I'm trying to start Frida from Windows cmd but its hanging and not proceeding to the second & command:
>adb -s 127.0.0.1:16480 shell "/mnt/shared/frida-server &" & frida -U -n system_server -l C:\Users\Documents\script.js
My intention is to avoid entering in shell with adb shell and then command
because im trying to start the server and call the hook from a single command.
But even entering on shell i still dont understand how to start/leave the server running on background and return:
>adb shell
SM-G7810:/ # /mnt/shared/frida-server &
[1] 2743
127|SM-G7810:/ # exit
You have running jobs
127|SM-G7810:/ #
On Windows cmd, you can use the
startcommand to run a process in the background and not wait for its completion. In your case, you can modify your command like this:This will start both commands in the background, and the cmd prompt won't wait for their completion. The
startcommand is used to open a new command prompt window for running the specified command. keep in mind that if the first commandchmod 755 /data/data/android/testfails, the second command may still be executed. If you want to ensure that the second command is executed only if the first one succeeds, you might need to use a more sophisticated script or batch file , However If you're running this from a script or batch file, you might also want to consider using thecallcommand to ensure that the script continues after the completion of the commands:with that the script will continue to execute the next command even if the first one fails
Update
consider using the
startcommand with the/Bswitch. This will start the command without opening a new window. example:The
/Bswitch is used to start the command without opening a new window. This should allow the command to run in the background, and the Command Prompt won't wait for it to complete.