The Android app connects a device to the MyDesk server. It uses an accessibility service to capture the screen and handle remote input.
- Android Studio, JDK 17 and Android SDK Platform 35.
- An Android device or emulator. Screen capture requires Android 11 / API 30 or newer. The minimum install version is Android 8 / API 26.
- A running MyDesk server.
The project includes the Gradle Wrapper, so a separate Gradle installation is not required.
- Open this
Androidfolder as a project. - Set the Gradle JDK to 17 in Android Studio settings.
- Install Android SDK Platform 35 through the SDK Manager and let Gradle sync finish.
- Connect a device with USB debugging enabled and accept its authorization prompt, or start an emulator.
- Select the
apprun configuration and click Run.
Android Studio builds, installs and opens the debug app.
Run these commands from the Android folder. Set JAVA_HOME to your JDK 17 installation. Set ANDROID_HOME to your Android SDK directory, or let Android Studio create local.properties with the SDK path. That file is ignored by Git because the path is specific to your computer.
On macOS or Linux:
./gradlew :app:assembleDebugOn Windows, in PowerShell:
.\gradlew.bat :app:assembleDebugThe APK is written to app/build/outputs/apk/debug/app-debug.apk.
To install it on a connected device or running emulator:
./gradlew :app:installDebugOn Windows, use .\gradlew.bat :app:installDebug. Open MyDesk Agent from the device's app list after installation.
- Open the web console on your computer and log in. On a new server, create the first owner account first.
- Create a pairing code in the console. It has 8 characters, works once and expires after 10 minutes by default.
- In MyDesk Agent, enter the server URL, a device name, the code and a device password of at least 8 characters.
- Tap the pairing button.
- Open accessibility settings from the app and enable MyDesk Remote Control.
- Return to the console. Once the device is online, enter its device password and open a session.
The device password is separate from the account password. The app does not save the pairing code or device password. It saves the server URL, device ID and name, and stores the device token encrypted with Android Keystore.
| Setup | URL to enter in the app |
|---|---|
| Android Studio emulator, server on your computer | http://10.0.2.2:8000 |
| Physical device on the same network | http://<computer-lan-ip>:8000 |
| Deployed server | https://<your-domain> |
For a physical device, start the development server with --host 0.0.0.0, connect both devices to the same network and allow inbound port 8000 on the computer. Do not enter localhost as the phone's server address.
Debug builds allow HTTP for local development. Release builds require HTTPS with a trusted certificate.
Keep the device unlocked and the accessibility service enabled. The console can display screenshots, send taps and swipes, enter text in supported fields and use Android navigation buttons. Text input depends on the app and field being controlled.
Use the pause button in MyDesk Agent to disconnect and stop remote control. The pause stays active after a restart; use the resume button to reconnect. Removing the local configuration lets you pair again. To revoke access on the server, use the device's revoke button in the console.
If the network connection drops, the app tries to reconnect. Open a new remote session once it is online again. Invalid or revoked credentials require a new pairing.
| Problem | Check |
|---|---|
| Gradle cannot find Java or the SDK | Select JDK 17 and check JAVA_HOME, ANDROID_HOME or local.properties. |
| Pairing fails | Check the server address, network, unused pairing code and device password length. Generate a new code if it has expired. |
| Device stays offline | Enable the accessibility service, resume control if paused and check the server is reachable. |
| No screenshots | Use Android 11 or newer, enable accessibility and keep the device unlocked. |
| HTTP URL is rejected | Install a debug build for local HTTP testing, or use an HTTPS server. |
./gradlew :app:testDebugUnitTestOn Windows, use .\gradlew.bat :app:testDebugUnitTest.