You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
About
Additional tools for controlling an Android device, used by mobile-cli, mobile-mcp and others