我有一个输入文本通过 adb shell 传递到其中的应用程序,现在问题是每当我输入命令时:
./adb shell 输入文本 'Khay'
工作得很好,它在应用程序的文本框中显示它应该是。但是当我传递很长的命令时,例如:
./adb shell input text ' http://stagingapi.something.com/v2/api.php?apikey=2323214\&appid=32432\&imei=324234 ........................................................
文本是不是太长了它给了我一个错误
错误:服务名称太长。
现在我有两个问题。
最佳答案
该问题的解决方法是将长命令写入本地 shell 文件,使用 adb push
推送文件,然后使用 sh
在设备上执行它。
因此,而不是执行:
adb shell input text ' http://...some.really.long.command...'
改为这样做:
echo "input text ' http://...some.really.long.command...'" > longcommand.sh
adb push longcommand.sh /data/local/tmp
adb shell sh /data/local/tmp/longcommand.sh
关于android - Adb Shell InputText 太长,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21089365/