0

I have a tablet connected to my home automation system. I would like my tablet to open an app when specific conditions are met.

My idea was to install some sort of SSH server on the tablet. When my server wants the tablet to open the App, it logins into the tablet and executes a command turn on the display and open the App.

In theory this works but I haven't been able to find any documentation on the web on how to do this.

I've got as far as installing SSHDroid however when the tablet locks, the SSH disconnects. I'm also unable to find any commands which turn on the display and open apps.

user2437672
  • 69
  • 1
  • 7
  • You can use `adb` over wireless, check this [answer](https://stackoverflow.com/a/3623727/1283715) for how to connect a device over network. – Khaled Lela Aug 02 '18 at 11:04

1 Answers1

0

From a computer, if you have USB access already (no root required), check this answer more details.

  • Connect your tablet with computer(has adb installed) and run

    adb tcpip 5555
    
  • Then you can control your tablet over wifi by run

    adb connect 192.168.0.101:5555 // you can use port forward in you gateway to enable you connect over internet.
    
  • Now after connected with tablet you are able to use adb shell commands.

Turn Screen On

adb shell input keyevent KEYCODE_POWER

Start an Application

adb shell am start -n com.package.name/com.package.name.ActivityName
Khaled Lela
  • 7,831
  • 6
  • 45
  • 73