问题
adb shell input text "&"
doesn't work, nor does adb shell input keyevent KEYCODE_AMPERSAND
.
Related to question 7789826.
回答1:
Try:
adb shell input text "\&"
回答2:
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.
来源:https://stackoverflow.com/questions/28468279/how-to-input-ampersand-with-adb-shell-input