Automatically connect to a physical desktop from Android

Forum / NoMachine for Mobile / Automatically connect to a physical desktop from Android

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44941
    Wellee
    Participant

    Hi!

    Is it possible to automatically connect to a remote computer from Android app?

    On Ubuntu I’m doing it this way:

    [Desktop Entry] Type=Application Name=NoMachine client Exec=/usr/NX/bin/nxplayer --session "path to the NXS file" --exit Icon=NoMachine Comment=NoMachine client automatic session X-GNOME-Autostart-enabled=true

    But I don’t know how to do it on Android. I have access to adb shell with root.

    Is it possible?

    #44991
    Tor
    Participant

    You can use the intent, try this:

    adb shell am start -a android.intent.action.VIEW -d file:///storage/emulated/0/Android/data/com.nomachine.nxplayer/files/NoMachine/Connection\\ name.nxs -t application/octet-stream

    Change the file “Connection name.nxs” in the example to the name you need, and remember to double escape spaces. You could also need to change the path of the NXS file, usually they are saved in the scoped storage, but you could have also a /sdcard/NoMachine directory.
    The first time you’ll do it, the system will show you a list of applications compatible with that mime type. Select NoMachine and toggle “Remember my choice”.
    When the application starts check the “Don’t show this message again” switch in the welcome panels, so the next time the connection will start immediately.

    #44992
    Wellee
    Participant

    Thanks Tor! That worked!

    Is it possible to run NoMachine when Android boots and run this command?

     

    Thanks again.

     

    #45001
    Tor
    Participant

    Happy to know it works!
    If you want to automatically run the application, you can look for an automation app in the store and configure a macro to open an NXS file with NoMachine. You can select the trigger (device boot, screen unlock, wifi state change, button presses, etc) and the action to execute (in our case “open file”).
    I’ve tried a couple of simple apps but I didn’t manage to start the application correctly after the device boots up. However I tried to run it when the screen unlocks, and it worked beautifully. Nice idea, thanks for sharing it!

    #45002
    Wellee
    Participant

    Thanks for your reply Tor!

    For anyone having this same problem, I managed to run NoMachine and automatically connect to a remote computer on Android boot adding a shell script under /data/adb/service.d

    The script contains:

    sleep 15
    am start -a android.intent.action.VIEW -d file:///sdcard/Android/data/com.nomachine.nxplayer/files/NoMachine/connection.nxs -t application/octet-stream

    It is necessary to have installed Magisk.

    Cheers!

Viewing 5 posts - 1 through 5 (of 5 total)

This topic was marked as solved, you can't post.