Skip to content

Commit e0c7581

Browse files
committed
fix: updated commands with respect to text with spaces
1 parent af385e8 commit e0c7581

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ that is not possible through adb-shell alone.
1414
Once the app is installed on your device or emulator, you can set the clipboard content using the following ADB command:
1515

1616
```bash
17-
adb shell am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "this can be pasted now"
17+
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "this can be pasted now"'
1818
```
1919

2020
### Clearing Clipboard via ADB
@@ -27,17 +27,19 @@ adb shell am broadcast -a devicekit.clipboard.clear -n com.mobilenext.devicekit/
2727

2828
```bash
2929
# Set clipboard content
30-
adb shell am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "Hello World"
30+
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "Hello World"'
3131

3232
# Using base64 for complex text (set 'encoding' to 'base64')
3333
adb shell am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e encoding "base64" -e text "4pyM77iP"
3434

3535
# Set special characters
36-
adb shell am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "こんにちは世界"
36+
adb shell 'am broadcast -a devicekit.clipboard.set -n com.mobilenext.devicekit/.ClipboardBroadcastReceiver -e text "こんにちは世界"'
3737
```
3838

3939
Since **devicekit** cannot force a keypress, use `adb shell input keyevent KEYCODE_PASTE` to paste clipboard onto current input text field.
4040

41+
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.
42+
4143
## Installation
4244

4345
1. Build the APK using Android Studio or Gradle

0 commit comments

Comments
 (0)