The Valentine‘s Day is coming. Here is an auto-input method and you may use it to send multiple words repeatedly.
For example, of course, you may want to send 999 "I love you." to your lover...
Or you may want to send couples into library, in order to devote themselves for our beloved country. XD
The codes are provided below. Note that the codes are for Android and Windows users. You may change them for IOS as you like.
-------------------------------
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 mention 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
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
1 @echo off 2 for /l %%i in (1,1,999) do adb shell input text "test"; input keyevent 66; 3 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
1 @echo off 2 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; 3 pause
Sent couples into library
1 @echo off 2 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; 3 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; 4 pause
Acknowledgement:
Thanks to Mr Zhuang Canjie of Tencent for his valuable idea and code on the platform of Linux.
-------------------------------
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
1 @echo off 2 for /l %%i in (1,1,999) do adb shell input text "I";input keyevent 62;input 3 text "love";input keyevent 62;input text "you."; input keyevent 66; 4 pause
7. 手机微信设置为回车发送,点输入框,使用英语输入法
8. 在命令行中输入 (文件名).bat, 运行批处理程序
[Android ADB] An auto-input method for Android and Windows
原文:http://www.cnblogs.com/zeedmood/p/6391195.html