adb shell输入带有空格的文本 [英] adb shell input text with space

查看:836
本文介绍了adb shell输入带有空格的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用adb shell input text发送带有某些文本" 之类的空格的文本?

How to send text with spaces like "some text" using adb shell input text ?

找到了以下解决方案

adb shell input text "some%stext"工作正常. 但是用%s替换空间的任何简单方法吗?

示例:

$ adb shell input text "some text"
Error: Invalid arguments for command: text
Usage: input [<source>] <command> [<arg>...]

The sources are: 
      keyboard
      mouse
      joystick
      touchnavigation
      touchpad
      trackball
      dpad
      stylus
      gamepad
      touchscreen

The commands and default sources are:
      text <string> (Default: touchscreen)
      keyevent [--longpress] <key code number or name> ... (Default: keyboard)
      tap <x> <y> (Default: touchscreen)
      swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
      press (Default: trackball)
      roll <dx> <dy> (Default: trackball)

推荐答案

您可以使用\<space>来做到这一点,就像这样:

You can do it with \<space>, like this:

adb shell input text "some\ text"

这篇关于adb shell输入带有空格的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆