参考https://askubuntu.com/questions/831331/failed-to-change-profile-to-headset-head-unit 备份
sudo systemctl restart ofono.service
ofono-phonesim -p 12345 /usr/share/phonesim/default.xml
/etc/systemd/system/ofono-phonesim.service
[Unit]
Description=Run ofono-phonesim in the background
[Service]
ExecStart=ofono-phonesim -p 12345 /usr/share/phonesim/default.xml
Type=simple
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
/etc/systemd/system/phonesim-enable-modem.service:
[Unit]
Description=Enable and online phonesim modem
Requires=ofono-phonesim.service
[Service]
ExecStart=/<path-to-cloned-ofono-git-repo>/test/enable-modem /phonesim
ExecStart=/<path-to-cloned-ofono-git-repo>/test/online-modem /phonesim
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Then run the following commands to run both daemons:
sudo systemctl daemon-reload
sudo systemctl enable ofono-phonesim.service
sudo systemctl enable phonesim-enable-modem.service
sudo service phonesim-enable-modem start
Check if the service is running with
sudo service phonesim-enable-modem status