nohup 執行檔 (為了背景執行),或可用 daemonize 取代,兩者都沒有的話可能必須依賴電腦pm 指令來取得)Start 後會顯示啟動指令)$ 表示為下指令,實際操作時請刪除。# 為註解,非指令# 進入 service-mamager/bin 資料夾$ cd bin# 確認電腦已經連接手機 (只能連接一支手機)$ ./adb.darwin devicesList of devices attachedLC53DYH00494 device# 確認 app_process32 是否存在,不存在請改用 app_process$ ./adb.darwin shell 'ls /system/bin/app_process32'/system/bin/app_process32# 確認 nohup 存在,不存在請改用 daemonize,兩者都不存在,可能要依賴電腦$ ./adb.darwin shell 'ls /system/bin/nohup; ls /system/bin/daemonize'/system/bin/nohup/system/bin/daemonize: No such file or directory# 確認 apk 安裝位置,請再次確認 Robotmon App 已經安裝$ ./adb.darwin shell 'pm path com.r2studio.robotmon'package:/data/app/com.r2studio.robotmon-1/base.apk# 組合啟動 Service 指令# 上述指令目的要湊出粗體字串# nohup sh -c "LD_LIBRARY_PATH=/system/lib:/data/data/com.r2studio.robotmon/lib:/data/app/com.r2studio.robotmon-1/lib/arm:/data/app/com.r2studio.robotmon-2/lib/arm CLASSPATH=/data/app/com.r2studio.robotmon-1/base.apk app_process32 /system/bin com.r2studio.robotmon.Main $@" > /dev/null 2> /dev/null &$ ./adb.darwin shell 'nohup sh -c "LD_LIBRARY_PATH=/system/lib:/data/data/com.r2studio.robotmon/lib:/data/app/com.r2studio.robotmon-1/lib/arm:/data/app/com.r2studio.robotmon-2/lib/arm CLASSPATH=/data/app/com.r2studio.robotmon-1/base.apk app_process32 /system/bin com.r2studio.robotmon.Main $@" > /dev/null 2> /dev/null &'# 確認 Service 是否啟動,啟動成功會出現類似下列訊息,第二欄位為 process id$ ./adb.darwin shell 'ps | grep app_process'shell 9512 9508 1570960 39576 ffffffff ecc9c570 S app_process32# 停止 Service$ ./adb.darwin shell 'kill 9512'# 確認是否成功停止 Service,沒出現額外訊息表示成功停止$ ./adb.darwin shell 'ps | grep app_process'# 進階排除錯誤,查看 Log。如果 Service 啟動失敗,手機會出現錯誤訊息來 Debug$ ./adb.darwin logcat# 訊息太多可用 grep 來 filter,關鍵字為 main, GoLog...$ ./adb.darwin logcat | grep main$ ./adb.darwin logcat | grep GoLog指令同 Mac,只需要把 ./adb.darwin 換成 ./adb.linux 即可
TODO
`test -e /system/bin/nohup && echo /system/bin/nohup` su -c "LD_LIBRARY_PATH=/system/lib:/data/data/com.r2studio.robotmon/lib:/data/app/com.r2studio.robotmon-1/lib/arm:/data/app/com.r2studio.robotmon-2/lib/arm CLASSPATH=`pm path com.r2studio.robotmon | cut -d ':' -f 2` app_process /system/bin com.r2studio.robotmon.Main $@" > /dev/null 2> /dev/null &0 Enable Root in settings in Nox
1 Install Termius App
2 Go to this URL (this page) https://sites.google.com/view/robotmon/%E9%80%B2%E9%9A%8E%E4%BD%BF%E7%94%A8/%E6%89%8B%E5%8B%95%E5%95%9F%E5%8B%95-service
3 Copy root command (bottom of page)
4 Paste command in Termius App and press enter
5 Service On !!