我有这个应用程序,输入文本通过adb shell传递,现在问题是每当我键入命令:
./adb shell输入文字'Khay'
工作得很好,它在应用程序的文本框中显示<"Khay">它应该是它.但是当我通过非常长的命令时,例如:
./adb shell input text ' http://stagingapi.something.com/v2/api.php?apikey=2323214\&appid=32432\&imei=324234 ........................................................
Run Code Online (Sandbox Code Playgroud)
是文本是这么长,它给我一个错误
错误:服务名称太长.
现在我有两个问题.
我能以某种方式使用adb shell传递这个长文本.
如果option1不可能那么我可以做什么来传递这个长输入文本
解决此问题的方法是将long命令写入本地shell文件,使用推送文件adb push,然后使用在设备上执行该文件sh.
所以不是执行:
adb shell input text ' http://...some.really.long.command...'
Run Code Online (Sandbox Code Playgroud)
改为:
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3078 次 |
| 最近记录: |