@echo ================================================
@echo     COPY, INSTALL AND START SERVICE
@echo ================================================
@echo START %date:~0,10% %time:~0,8%

@echo ------------
@hdc shell mount -o remount,rw /
@hdc shell mount -o remount,rw /vendor
@rem 终止主进程和所有子进程
@hdc shell "killall -9 sonycamera_exe || true"

@hdc file send sonycamera_exe /vendor/bin
@hdc shell chmod a+x /vendor/bin/sonycamera_exe

@echo ------------
@echo Starting sonycamera_exe service...

@rem 终止主进程和所有子进程
@hdc shell "killall -9 sonycamera_exe || true"

@rem 在后台启动新进程
@hdc shell "/vendor/bin/sonycamera_exe"

@rem 等待几秒确保进程启动
@timeout /t 2 /nobreak > nul

@rem 验证进程是否成功启动
@hdc shell "ps | grep sonycamera_exe"

@echo ------------

@echo END %date:~0,10% %time:~0,8%
pause
