现象:华硕手机无法被识别,插上以后,日志报错:
2021-08-05T03:18:20.757Z FTL/device 5498 [K1AXGF01376762H] Setup had an error Error: Service had an error: "Error: Not found; no service started."
2021-08-05T03:18:20.759Z FTL/util:lifecycle 5498 [K1AXGF01376762H] Shutting down due to fatal error
2021-08-05T03:18:20.773Z ERR/provider 4807 [*] Device worker "K1AXGF01376762H" died with code 1
原因:手机不允许在初次安装的时候直接启动 service,需要 “激活” activity,才能 “注册” 上 service。
解决:
# 进入 stf 目录
%cd stf/
# 安装 STFService.apk
%adb install -r vendor/STFService/STFService.apk
Performing Streamed Install
Success
# 查看已安装包
%adb shell pm list packages
# 搜索 stf,发现 STFService.apk 包名:
package:jp.co.cyberagent.stf
# 卸载 STFService.apk
%adb uninstall jp.co.cyberagent.stf
# 再次安装 STFService.apk
%adb install -r vendor/STFService/STFService.apk
#am (Activity Manager) 命令用来启动一个 APP、启动 Activity、启动广播和服务等等
# 启动 stf IdentityActivity
%adb shell am start -n jp.co.cyberagent.stf/.IdentityActivity
可能输入此命令设备红屏,见:
即使设备红屏也输入下命令:
# 启动 stf 服务
%adb shell am startservice -n jp.co.cyberagent.stf/.Service