4

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

Related to question 7789826.

7
  • Does either of these work? adb shell input text ^&, adb shell input text "^&". Feb 12, 2015 at 4:33
  • adb shell "input text \&"
    – Alex P.
    Feb 12, 2015 at 17:42
  • I am also using Arch Linux and bash, and Paresh's answer works for me. If it doesn't work for you, I don't know why not... maybe we have different versions of Android or adb. I'm running Cyanogenmod 11. I could try later on my other phone that has Android 4.1. Feb 12, 2015 at 22:18
  • adb shell input text "\&" works on both of my phones. Feb 13, 2015 at 2:55
  • adb 1.0.32, CyanogenMod 11-20141008-SNAPSHOT-M11-hammerhead, Android 4.4.4 Feb 13, 2015 at 10:07

2 Answers 2

4

Try:

adb shell input text "\&"
4
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.

1
  • thanks for the answer Anthony, and welcome to StackOverflow!
    – Tim Malone
    May 24, 2016 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.