4

adb shell input text "&" doesn't work, nor does adb shell input keyevent KEYCODE_AMPERSAND.

Related to question 7789826.

Alex Henrie
  • 744
  • 1
  • 6
  • 17

2 Answers2

4

Try:

adb shell input text "\&"
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
0

For anyone stumbling across this in the future, the escape that finally worked from me was not \&, but rather "\&"

as in

adb shell echo Macaroni "\&" Cheese

and not

adb shell echo Macaroni \& Cheese

Hopefully this helps someone.

For the record, this is on Windows.