Context
I know that I can use the following command to copy a string to the clipboard
$ adb shell am start-activity \
-a android.intent.action.SEND \
-e android.intent.extra.TEXT "foo" \
-t text/plain \
com.tengu.sharetoclipboard
I also know that when the string has a space character, the space character needs to be escaped
$ adb shell am start-activity \
-a android.intent.action.SEND \
-e android.intent.extra.TEXT "foo\ bar" \
-t text/plain \
com.tengu.sharetoclipboard
Now, I want the string to have a newline character. I've tried the following commands with no avail.
$ adb shell am start-activity -a android.intent.action.SEND -e android.intent.extra.TEXT "foo\nbar" -t text/plain com.tengu.sharetoclipboard
$ adb shell am start-activity -a android.intent.action.SEND -e android.intent.extra.TEXT "foo\\nbar" -t text/plain com.tengu.sharetoclipboard
$ adb shell am start-activity -a android.intent.action.SEND -e android.intent.extra.TEXT "foo\rbar" -t text/plain com.tengu.sharetoclipboard
$ adb shell am start-activity -a android.intent.action.SEND -e android.intent.extra.TEXT "foo\\rbar" -t text/plain com.tengu.sharetoclipboard
Any ideas on how to make the newline character to be inserted in the clipboard?
System information
- Phone model name: Samsung Galaxy A12
- Phone model number: SM-A127M
- Android v11
- Share to Clipboard v1.15.0
PS: I referenced this issue in this comment at Stack Overflow.
Context
I know that I can use the following command to copy a string to the clipboard
I also know that when the string has a space character, the space character needs to be escaped
Now, I want the string to have a newline character. I've tried the following commands with no avail.
Any ideas on how to make the newline character to be inserted in the clipboard?
System information
PS: I referenced this issue in this comment at Stack Overflow.