João Cartucho
João Cartucho

Reputation: 3916

Android - adb shell input text apostrophe ' signal

I wanted the shell to write the following text:

''Hello, it's been great.''

I managed to write

Hello, its been great.

with:

adb shell input text 'Hello,%sits%sbeen%sgreat.'

Any ideas if it is possible to write the (') signal? Before Hello two of them, in it's and in the end.

Upvotes: 1

Views: 1291

Answers (1)

Jeeter
Jeeter

Reputation: 6105

From the doc for ADB:

“adb shell setprop foo ‘a b’” command is now an error because the single quotes (‘) are swallowed by the local shell, and the device sees “adb shell setprop foo a b”. To make the command work, quote twice, once for the local shell and once for the remote shell, the same as you do with ssh(1). For example, “adb shell setprop foo “‘a b’””

So just do:

adb shell input text "''Hello,%sit's%sbeen%sgreat.''"

Upvotes: 3

Related Questions