Closed nathaneltitane closed 4 years ago
@xeffyr can I bug you on this one:
what would be the command to pass through termux's am to kill a specific application?
Thank you
Not sure whether it is possible to stop random activities but you can stop service with something like
am stopservice com.termux/.app.TermuxService
Replace package name & service class name with appropriate values.
For example, if you use VNC Viewer by RealVNC, try this command:
am stopservice com.realvnc.viewer.android/.app.ConnectionService
Thank you @xeffyr! i will look into the manifests to get the info :)
EDIT:
so having realvnc viewer already installed, even when launching a vnc connection, there does not seem to be any active service running that calls on com.realvnc.viewer.android.app.ConnectionService although the manifest clearly lists
<service android:exported="false" android:name="com.realvnc.viewer.android.app.ConnectionService" android:stopWithTask="true"/>
Am I doing this wrong? Should i explicitly launch the service from termux to have it be closed by am afterwards?
Sidenote:
Just for discussion's sake and the possible use cases made of termux such as my project: what are the odds termux could build it's own vnc viewer that ties into the already existing product and has users control the session à la LinuxOnDex?
there does not seem to be any active service
This is not true. com.realvnc.viewer.android.app.ConnectionService
is a background job responsible for VNC connection.
Seems like regular application can stop only its own services. I was not able to stop it from Termux but from ADB with root permissions command from https://github.com/nathaneltitane/linux-dextop/issues/1#issuecomment-701973956 worked fine:
heroltexx:/ # am stopservice com.realvnc.viewer.android/.app.ConnectionService
Stopping service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.realvnc.viewer.android/.app.ConnectionService }
Service stopped
Use am to kill app that serves vnc:// intent when display is loaded to not have it hang in background and prevent other session(s) from loading.