首先编写 cmd.bat 文件,内容如下:
cd /data/local/tmp
#判断进程是否存在
ps | grep frida-server
if [ $? -ne 0 ]
then
#这里frida文件名修改成你自己下载的
chmod 777 frida-server-12.10.4-android-x86
./frida-server-12.10.4-android-x86 &
echo "start successfully!"
ps | grep frida-server
else
echo "runing!"
fi
接着编写 run.bat
adb shell < cmd.bat
adb forward tcp:27042 tcp:27042
pause
保证两个文件在同一目录下运行 run.bat
启动成功/已经启动结果展示
C:\Users\admin\Desktop>adb shell 0<cmd.bat
start successfully!
root 7877 7872 34448 4736 0 b5c2fa90 R ./frida-server-12.10.4-android-x86
C:\Users\admin\Desktop>adb shell 0<cmd.bat
root 7254 1 85780 50068 poll_sched b5bd5a90 S ./frida-server-12.10.4-android-x86
runing!
C:\Users\admin\Desktop>adb forward tcp:27042 tcp:27042