Frida server is the one of the requirement to run the scripts into the devices. If you try to run the script without running the server, you will get the error shown below:

frida -U  -f owasp.mstg.uncrackable1 -l ./03-rootbypass/crackme1-rootbypass.js
     ____
    / _  |   Frida 16.5.5 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
   . . . .
   . . . .   Connected to Android SDK built for x86 64 (id=localhost:5555)
Failed to spawn: need Gadget to attach on jailed Android; its default location is: /home/user/.cache/frida/gadget-android-arm64.so

First download the Frida server according to you physical / emulated device version. You can get details of your device from the settings.

9dc4c0a934b8b6c7f753557da22778b4.png

Then download the Frida server from the link provided in [1]

After uncompressing the server file, use the following command to push the server into the device.

adb push ./frida-server-16.5.6-android-x86_64 /data/local/tmp/

Drop to the shell using the adb shell command and run the below:

1|generic_x86_64:/ $ su
generic_x86_64:/ # setenforce 0
generic_x86_64:/ # /data/local/tmp/frida-server-16.5.6-android-x86_64 &
[1] 2877

If you get the following error, that means you are not ‘su’.

Unable to load SELinux policy from the kernel: Failed to open file ?/sys/fs/selinux/policy?: Permission denied

Reference#

  1. https://github.com/frida/frida/releases