[Android ADB] An auto-input method for Android and Windows
The Valentine's Day is coming. Here is an auto-input method and basically, it can be used to send multiple words repeatedly.
For example, You may want that
1. When your boy friend/girl friend wakes up in the morning of Valentines's Day, he/she will see 999 messages of "I love you.";

2. ...Or send those happy couples into library, in order to push them to devote themselves for our beloved country. XD
The codes are provided below. Note that
1. The following codes are for Android and Windows users. There are codes for Mac or Linux in the very end of this blog.
2. Use the code when your target is sleep to avoid disturb he/she, e.g., 3:00 am.
3. When your target asks you how to do this, it may be better to keep it mysterious: just tell he/she that believe it or not, you type the words all night for he/she :P
-------------------------------
The auto-input method - ADB Introduction
Android Debug Bridge (ADB) is a versatile command line tool that lets you communicate with an emulator instance on your PC or connected Android device. It comes bundled with the Android SDK and allows developers to communicate with their device for debugging or taking logs for further analysis. To use ADB, you need to enable USB Debugging on your device which is like an access port that allows users to send commands to the Android via PC. Additionally, it’s advisable to read the below article before enabling USB Debugging on your device as it can also make your device vulnerable to backdoor attacks.
The auto-input method - Steps
Here is an auto-input method. As mentioned above, you may use it to send multiple words repeatedly, which is may be funny for the valutine's day. Below shows the steps of how to do the auto-input:
1. Connect your phone with your computer using a USB line and enter the USB debugging mode
http://www.droidape.com/all-you-need-to-know-about-usb-debugging-on-android/
2. Download adb by searching "adb windows", and you should find a website like this:
https://developer.android.com/studio/releases/platform-tools.html#download
3. Test adb
Unzip the adb to a certain location, e.g., C:\adb_windows
Start the Window CMD (by pressing Windows+R), enter the above dicrtory, e.g., c:> cd C:\adb_windows
Start adb server, i.e., c:\adb_windows> adb shell
Everything goes well if you see:
* daemon not running. starting it now *
* daemon started successfully *
If not, please check your phone driver and phone assistance softwares (they may have their own adb blocking now) in the computer.
http://stackoverflow.com/questions/5092542/adb-server-is-out-of-date
5. Exit the adb input space, e.g., $ exit
6. Put in the code
In the adb directory, e.g., C:\adb_windows, create a .txt file, e.g., test.txt,
Input the following code,
Change the file as .bat, e.g., test.bat
@echo off
for /l %%i in (1,1,999) do adb shell input text "test"; input keyevent 66;
pause
7. Open your wechat or whatsapp
Your wechat or whatsapp should be able to send text by clicking enter.
You click the text box on the phone and set the input method as English.
8. Enjoy your code
in the CMD, input (file name).bat, e.g., test.bat,
run the .bat, e.g., c:\adb_windows> test.bat
I love you x 999
@echo off
for /l %%i in (1,1,999) do adb shell input text "I";input keyevent 62;input text "love";input keyevent 62;input text "you."; input keyevent 66;
pause

Sent couples into library
@echo off
adb shell input text "Sent";input keyevent 62;input text 1;input keyevent 62;input text "couple";input keyevent 62;input text "into";input keyevent 62;input text "library.";input keyevent 66;
for /l %%i in (2,1,999) do adb shell input text "sent";input keyevent 62;input text %%i;input keyevent 62;input text "couples";input keyevent 62;input text "into";input keyevent 62;input text "library.";input keyevent 66;
pause

The code can be used under Mac/Linux, via Mr Zhuang Canjie of Tencent.
#!/bin/sh
for((i=;i<=;i=i+))
do
adb shell input text "I";
adb shell input keyevent ;
adb shell input text "love";
adb shell input keyevent ;
adb shell input text "you.";
adb shell input keyevent ;
done
exit
-------------------------------
Appendix - Steps In Chinese
步骤如下:
1. USB准备工作
插USB线,打开手机USB调试模式
2. 下载adb
搜索adb windows 并下载
https://developer.android.com/studio/releases/platform-tools.html#download
3. 启动CMD(windows键+R , 然后输入 cmd 按回车)
4. 安装ADB
解压(内含adb.exe AdbWinApi.dll AdbWinUsbApi.dll),进入到我们的adb.exe程序所在目录,执行adb shell
如:adb解压在c盘的C:\adb_windows目录。然后在小黑窗口输入cd C:\adb_windows,
接下来输入abd shell:
c:> cd C:\adb_windows
c:\adb_windows> adb shell
* daemon not running. starting it now *
* daemon started successfully *
$
出现以上就成功
否则则检查手机驱动是否安装,手机助手一类是否关闭(手机助手可能会自带adb导致端口被占用)
5. 退出adb
$ exit
6. 在adb所在文件夹内新建一个.txt文件将下面代码拷入,将后缀名改为 .bat
@echo off
for /l %%i in (1,1,999) do adb shell input text "I";input keyevent 62;input
text "love";input keyevent 62;input text "you."; input keyevent 66;
pause
7. 手机微信设置为回车发送,点输入框,使用英语输入法
8. 在命令行中输入 (文件名).bat, 运行批处理程序
[Android ADB] An auto-input method for Android and Windows的更多相关文章
- Android Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
问题:Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List ...
- Caused by:java.lang.IllegalStateException at android.media.MediaPlayer._setDataSource(Native Method)
使用Mediaplayer播放本地音频,在第二次调用mediaplayer.setDataSource()时报错如下: Caused by: java.lang.IllegalStateExcepti ...
- 错误:Camera录制视频(6.0错误),5.1正常,7.1正常 (java.lang.RuntimeException: start failed.at android.media.MediaRecorder.native_start(Native Method))
Process: com.example.mycamera2, PID: 24086 java.lang.RuntimeException: start failed. at android.medi ...
- Android窗口管理服务WindowManagerService对输入法窗口(Input Method Window)的管理分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8526644 在Android系统中,输入法窗口 ...
- Android adb input 命令介绍
input命令是用来向设备发送模拟操作的命令: 因为版本不同,input命令也有所不同 以下为Android 4.0的input命令: usage:input text <string> ...
- Android ADB 实用总结
一.背景 从系统架构上来说,Android是基于Linux系统基础上,做了进一步的定制与修改,并融入了自身的特有功能,且向应用层提供应用程序接口,供开发者使用.系统内核层面,主体依然是Linux内核. ...
- Android ADB命令详解
adb的全称为Android Debug Bridge.是android司机经常用到的工具 . 你能在本篇文章中学到什么? adb基本指令 Shell AM&PM adb模拟用户事件 logc ...
- Android ADB命令?这一次我再也不死记了!【简单说】
https://www.jianshu.com/p/56fd03f1aaae adb的全称为Android Debug Bridge.是android司机经常用到的工具.但是问题是那么多命令写代码已经 ...
- Android ADB工具-操作手机和获取手设备信息(四)
Android ADB工具-操作手机和获取手设备信息(四) 标签(空格分隔): Android ADB 6. 其它命令 命令 功能 adb shell input text <content&g ...
随机推荐
- 位图文件(BMP)格式以及Linux下C程序实现(转)
源:位图文件(BMP)格式以及Linux下C程序实现 说到图片,位图(Bitmap)当然是最简单的,它是Windows显示图片的基本格式,其文件扩展名为*.BMP.由于没有经过任何的压缩,故BMP图 ...
- windows下Nodejs环境部署
前言 Nodejs是基于v8引擎的轻量级框架,其特点为事件驱动.非阻塞.单线程.异步回调等. Nodejs相对于其他运行在服务器端的语言,容易学习,使用方便. 本文将介绍windows下Nodejs的 ...
- css中盒子宽高的auto
CSS盒模型中,auto属性只适用于外margin和width,height,border和padding不适用.下面就来说说它的情况.这里所说的都是标准流盒子. 1.横向来说 (1)若设置width ...
- AForge.NET是一个专门为开发者和研究者基于C#框架设计的视频录像
AForge.NET是一个专门为开发者和研究者基于C#框架设计的,他包括计算机视觉与人工智能,图像处理,神经网络,遗传算法,机器学习,模糊系统,机器人控制等领域.这个框架由一系列的类库组成.主要包括有 ...
- JMeter使用代理录制脚本
用JMeter做接口测试,有时候接口数量比较多,用录制方式可以节省很多时间,录制接口可以配合badboy使用,但是badboy访问的浏览器是基于ie6的,基本上现在的网站不会对ie6做兼容了,使用代理 ...
- Swoole:重新定义PHP
Swoole PHP语言的高性能网络通信框架,提供了PHP语言的异步多线程服务器,异步TCP/UDP网络客户端,异步MySQL,数据库连接池,AsyncTask,消息队列,毫秒定时器,异步文件读写,异 ...
- 1.4.2.4. SAVING(Core Data 应用程序实践指南)
现在,要添加一个保存修改的方法.其实很简单,就是调用持久化存储协调器的save方法. - (void)saveContext { ) { NSLog(@"Running %@ '%@'&qu ...
- Linux内存布局
在上一篇博文里,我们已经看到Linux如何有效地利用80x86的分段和分页硬件单元把逻辑地址转换为线性地址,在由线性地址转换到物理地址.那么我们的应用程序如何使用这些逻辑地址,整个内存的地址布局又是怎 ...
- java中Array/List/Map/Object与Json互相转换详解(转载)
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式.易于人阅读和编写.同时也易于机器解析和生成.它基于JavaScript Programming Langu ...
- PHP不使用?>结尾会更好!
在看别人的代码时发现经常有人不使用 ?> 结尾符. 尤其是在使用include之后,不使用的频率更高. 于是查了一下: 文件末尾的 PHP 代码段结束标记可以不要,有些情况下当使用 includ ...