An Android app that is a set of tools for controlling Android devices, changing configuration that is not possible through adb-shell alone.
- Control clipboard content with support for utf8
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/0.0.10/mobilenext-devicekit.apk
adb install -r mobilenext-devicekit.apk
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"'
adb shell am broadcast -a devicekit.clipboard.clear -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver
# 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.
- 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
The app logs all broadcast reception events. You can view logs using:
adb logcat -s ClipboardReceiver
- Android 10 (API 29) minimum