Search code examples
androidadb

adb shell input text does not take & ampersand character


When I do enter some text with & character then my complete text is not entered on the device.

D:\Apps\Android-SDK\tools>adb shell input text hello&hello
'hello' is not recognized as an internal or external command,
operable program or batch file.

It entered only hello. but the other & and hello characters are not entered.

How can I enter the & character?


Solution

  • You need to encapsulate your string in quotes and escape your ampersand "hello\&hello"