senzhk / ADBKeyBoard

Android Virtual Keyboard Input via ADB (Useful for Test Automation)
GNU General Public License v2.0
1.22k stars 299 forks source link

how to input quotes and double quotes? #34

Closed amoxuk closed 4 years ago

amoxuk commented 4 years ago

I try to input the test text adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文输入test'" perfected on python script by decode('utf-8').encode('utf-8')! but when I want input a qoutes or double quotes, it runs failed. FAIL: adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\'输入test'" or adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\"输入test'" or adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\\"输入test'" return /system/bin/sh: no closing quote

so, how to input quotes and double quotes by comand line or python?

senzhk commented 4 years ago

I think you better try the latest base64 wrapper:

1.1 Sending text input (base64) if (1) is not working.