What is the best way to add a SystemD service?

At the undermentioned, I’ve been advised to add a service to enable ADB support in the Android Studio Flatpak package. However, I’m unfamiliar with the process:

(For the sake of linkrot prevention), the undermentioned is the service’s content:

[Unit]
Description=Android Debug Server Daemon

[Service]
Type=forking
ExecStart=%h/android/sdk/platform-tools/adb start-server
ExecStop=%h/android/sdk/platform-tools/adb kill-server

[Install]
WantedBy=default.target

Alternatively, if this is somehow an X/Y problem (despite it being the recommendation of the developers) because, for instance, I can bypass this with Flatseal, please recommend an easier solution!

Is this what you are looking for?

Copy the .service file into /etc/systemd/system
Then enable and start the service sudo systemctl enable --now <service-name>

Becuase it’s enabled (WantedBy default.target) it will start up each time you boot the system.

1 Like

@barryascott, apologies for the wait, and thank you. I’ll try this if it turns out I do actually need to do this. However, per the responses in the cited thread, I think I’m just being given the run-around.