I am developing an Android and IOS app which I am going to use to remotely control the camera. The app is running 24/7 on the phone in a place not accessible by me. I would like to be able to connect to the phone remotely at any time and perform any action. While screensharing is not a problem, I don't know how to control the device.
How can I achieve that?
One crazy idea i have is to use a esp32 board connected through the OTG like a keyboard and send the commands to it via BLE connection from my custom app on the phone, so the board emulates corresponding keystrokes and mouse movements. But i think that's and overkill.
For anyone interested—Splashtop Enterprise allows you to control Android device in fully unattended mode (It can even unlock screen etc). They partner directly with Android device manufacturers, and their APK is whitelisted by the OS, so it is considered "Trusted," granting full phone access to it.
The price is $1,000 USD/year per license. One license allows you to deploy Splashtop to 300 phones and have one remote session at a time.
About iOS: For iOS, there is no software that can control the device remotely. You can only view the screen (via Splashtop or another service). One idea that comes to mind is to design a piece of hardware, like a wired or wireless keyboard based on ESP32 or similar board, that accepts Bluetooth commands from a custom app on the phone and emulates corresponding key presses and mouse actions (as wired or ble hid). The bluetooth can run in the backgrounds on IOS forever without any problems, so you can leave the iPhone in inaccessible place for unlimited amount of time and connect to it at any time.