1 Clipper介绍
Clipper是一款简单的app, 它可以通过一行adb shell命令来和安卓系统剪切板服务交互。
官方说明:https://github.com/majido/clipper
2 App下载
3 使用方法
安装App
启动广播服务
adb shell am startservice ca.zgrs.clipper/.ClipboardService
get方法:print the value in clipboard into logs
am broadcast -a clipper.get
set方法:sets the clipboard content to the string passed via extra parameter "text"
am broadcast -a clipper.set -e text "this can be pasted now"
4 appium中使用的一个例子
某个安卓手机先安装Clipper.apk
然后开启广播
//执行shell命令开启android广播服务
Process process = Runtime.getRuntime().exec("adb -s "+udid+" shell am broadcast -a clipper.get");
InputStream is=process.getInputStream();
InputStreamReader isr= new InputStreamReader(is, "utf-8");
BufferedReader br= newBufferedRead