启动 Service(Android 8+ 受后台限制,前台服务用 am start-foreground-service)
adb shell am startservice 是「进程与系统」分类下的常用命令,作用是:启动 Service(Android 8+ 受后台限制,前台服务用 am start-foreground-service)。
典型用法如下:adb shell am startservice -n com.example.demo/.SyncService。你可以查看本页上方同组的相关命令,或直接复制到终端运行。
adb shell am startservice -n com.example.demo/.SyncService 即可,具体参数请按实际环境调整。