devicekit-android
Additional tools for controlling an Android device, used by mobile-cli, mobile-mcp and others
GitHub Stars
7
User Rating
Not Rated
Favorites
0
Views
2
Forks
0
Issues
0
Mobile Next Device Kit
An Android app that is a set of tools for controlling Android devices, changing configuration
that is not possible through adb-shell alone.
Features
- Control clipboard content with support for utf8
- Stream screen buffer as mjpeg (with scaling and quality parameters)
Installing
Simply download the latest release from github releases, install the package onto your device, and see Usage section below for commands.
You may also just automate it all by running the copy-pasting the following script onto your terminal:
curl -s -O -J -L https://github.com/mobile-next/devicekit-android/releases/download/1.1.13/mobilenext-devicekit.apk
adb install -r mobilenext-devicekit.apk
Usage
Setting Clipboard via ADB
Once the app is installed on your device or emulator, you can set the clipboard content using the following ADB command:
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "this can be pasted now"'
Clearing Clipboard via ADB
adb shell am broadcast -a devicekit.clipboard.clear -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver
Examples
# Set clipboard content
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "Hello World"'
# Using base64 for complex text (set 'encoding' to 'base64')
adb shell am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e encoding "base64" -e text "4pyM77iP"
# Set special characters
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "こんにちは世界"'
Since devicekit cannot force a keypress, use adb shell input keyevent KEYCODE_PASTE
to paste clipboard onto current input text field.
Note that the single quotes after adb shell
are required if your text includes spaces. The base64 encoding allows you to safely transfer whatever utf8 you wish to paste.
Installation
- Build the APK using Android Studio or Gradle
- Install on your device:
adb install app/build/outputs/apk/debug/app-debug.apk
- Launch the app to verify it's running
- Use the ADB commands above to set clipboard content
Debugging
The app logs all broadcast reception events. You can view logs using:
adb logcat -s ClipboardReceiver
Requirements
- Android 10 (API 29) minimum
86
Followers
8
Repositories
0
Gists
0
Total Contributions