senzhk / adbkeyboard Goto Github PK
View Code? Open in Web Editor NEWAndroid Virtual Keyboard Input via ADB (Useful for Test Automation)
License: GNU General Public License v2.0
Android Virtual Keyboard Input via ADB (Useful for Test Automation)
License: GNU General Public License v2.0
example: adb shell am broadcast -a ADB_INPUT_TEXT --es msg ‘你好 啊’
文本中间带有空格,输入无响应
使用 adb shell am broadcast -a ADB_INPUT_TEXT --es msg '你好嗎? Hello?' , 无法显示, 如果是adb shell am broadcast -a ADB_INPUT_TEXT --es msg 'Hello?'就可以显示
模拟器使用 Android O
我在ubuntu16.04端使用该apk和命令是完全正常的,但是在windows10端cmd直接输入中文会无法识别,如果通过其他代码(如Python)读入中文文档传入字符串,会全部变成乱码...
具体的原因是windows端的adb对于中文的接受很不友好。
实际上windows的cmd(以及powershell)是可以接受中文的,例如:
cd 下载
是可以进入中文的文件夹的。
但是使用adb传入中文会出问题,例如:
adb shell uiautomator dump /data/local/tmp/测试.xml
返回值会显示 乱码.xml .
解决方法:需要使用修改过的可以兼容中文的adb
例如: https://download.csdn.net/download/wanliaixie/6286541
Intent { act=ADB_INPUT_TEXT pkg=Hello?' (has extras) }
hi
i am trying to use the keyboard to send hebrew characters to my mobile
adb shell am broadcast -a ADB_INPUT_TEXT --es msg 'HEBREW WORD'
but it is not running, when i use
am broadcast -a ADB_INPUT_CHARS --eia chars '1502,1497,1499,1488,1500'
it is working successfully
any idea ?
Just wanna to say - THANK YOU!
The app is broken with meta key codes on modern androids.
I already tested on some Android 8+ devices, not only real devices but also emulators.
Therefore, I modified the function in order to make it work.
Now I can send Ctrl + A as below: 4096 is META_CONTROL_ON, 8192 is META_CONTROL_LEFT_ON, 29 is KEYCODE_A
adb shell am broadcast -a ADB_INPUT_TEXT --es mcode '4096,29' // one metaState.
or
adb shell am broadcast -a ADB_INPUT_TEXT --es mcode '4096^|^8192,29' // two metaState.
Anyways, I appreciate your works.
I've reformated my device. Anyone have APK?
IT was here before:
https://github.com/senzhk/ADBKeyBoard/blob/master/bin/ADBKeyBoard.apk
hi,安装的时候提示这个错误,请帮忙看一下原因
adb: failed to install C:\Users\XX\Desktop\ADBKeyboard.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl1096252406.tmp/base.apk: AndroidManifest.xml]
Could you update it ?
使用命令:adb -s 127.0.0.1:21503 shell am broadcast -a ADB_INPUT_TEXT -e msg '123'
在模拟器上执行时会导致ADBKeyBoard异常停止
Tried the ADB_INPUT_CODE, but seems no luck
Service根本就起不来,监听不到adb 发出来的消息。
例如,我希望打一段中文,然后,立刻从 android 的 QQ 的聊天窗口发出去。
我有这样一个 bash 函数:
function adb_key () {
adb shell am broadcast -a ADB_INPUT_TEXT --es msg "$*\n"
}
这里的 \n 似乎是无效的, 发了个 \n 到 QQ, 而不是回车。
As title, input chinese use base64 way will generate space after sting.
Good day. Trying to compile but gor error:
./gradlew --info installDebug
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.0.2'.
Hi,
The keyboard via ADB not working.
Testing in 6.0.1 and 4.4.2
Do not know the characters that I send or print only "????"
Greetings.
When I use the Base 64 command as below:
adb shell am broadcast -a ADB_INPUT_B64 --es msg `echo '你好嗎? Hello?' | base64`
I get the error:
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:66
+ ... b shell am broadcast -a ADB_INPUT_B64 --es msg echo 'Hello?' | base64
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (base64:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException```
Please provide steps for installation on windows machine with MEmu android emulator
Currently there is no normal way to clear text of focused android input.
Is it possible to use this keyboard for cleaning input?
I try to input the test text
adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文输入test'"
perfected on python script by decode('utf-8').encode('utf-8')
!
but when I want input a qoutes or double quotes, it runs failed.
FAIL:
adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\'输入test'"
or
adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\"输入test'"
or
adb shell "am broadcast -a ADB_INPUT_TEXT --es msg '中文\\"输入test'"
return /system/bin/sh: no closing quote
so, how to input quotes and double quotes by comand line or python?
hi
i have the following scenario:
i am using my regular samsung keyboard
from adb shell i change the keyboard and type text and nothing happened, ONLY when i manually tap the editbox i get a message of ADB Keyboard{ON} and only now i can send the keys
it's like changing the keyboard is not enough , you should also operate it somehow
is there a way to avoid it? i need to run it without manual intervention ???
thanks.
ime set com.android.adbkeyboard/.AdbIME
am broadcast -a ADB_INPUT_TEXT --es msg 'test'
I sent follow url:
adb shell am broadcast -a ADB_INPUT_TEXT --es msg 'http://example.ru/?exampleparams=Анаграмма%20английский%20онлайн'
But words with cyrillic broken.
I use ADBKeyBoard on Android 9.
It works very nice! Thanks.
Does ADBKeyBoard work on Android 10/11?
We want to input Chinese in Android Emulator.
We download this zip file.
But inside it all we find is a README.md which doesn't say where we are supposed to put the zip etc. etc.
Thanks Eric for ADBKeyBoard!! It is very good!
Some examples for comfortable usage:
Switch to ADBKeyBoard from adb:
adb shell ime set com.android.adbkeyboard/.AdbIME
Switch back to original virtual keyboard: (swype in my case...)
adb shell ime set com.nuance.swype.dtc/com.nuance.swype.input.IME
(Check your available le virtual keyboards:
ime list -a
)
Use simple quote characters -not double as in example above- if your shell not accepts "!" (explanation sign)
adb shell am broadcast -a ADB_INPUT_TEXT --es msg 'Accented characters here'
Use adb over wifi to simplify your life... :)
adb -s 127.0.0.1:21503 shell am broadcast -a ADB_INPUT_B64 --es msg "0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQ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CwINCj0LrRgNCw0LjQvdC1IQrQodC70LDQstCwINCj0LrRgNCw0LjQvdC1IQrQodC70LDQstCwINCj0LrRgNCw0LjQvdC1IQrQodC70LDQstCwINCj0LrRgNCw0LjQvdC1IdCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUhCtCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUhCtCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUhCtCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUhCtCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUhCtCh0LvQsNCy0LAg0KPQutGA0LDQuNC90LUh0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSEK0KHQu9Cw0LLQsCDQo9C60YDQsNC40L3QtSE="
dont work with error
error: service name too long
how fix it ?
failed to find Build Tools revision 23.0.2
How can I solve it ?
Why not to add some default android keyboard to not switching it each time you need type something manually?
Send on device
http://b.photobucket.com/pbkt/hserver/viewid=5870663323/size=RECTANGLE/random=270278/area=lib_media/age=44/gender=M/reg_zip=m6b1h9/username=Aron-in-Toronto/login=Y/cam_make=canon/cam_type=PnS/sp=t/ownername=Aron-in-Toronto/search_kw=empty/ptype=browse/pos=inf/likes=n/spon=empty/adCount=empty/ref_domain=bingcom/feature=/site=pb2/track=empty/anprice=/generic=http%3A%2F%2Fnym1.ib.adnxs.com%2Fab%3Fenc%3DRmeXLCKt4T8Y7XaDPdHfPwAAAAAAABxAGO12gz3R3z9GZ5csIq3hPx0Vro0ode89f4Jy7idho1lLLXpTAAAAADoPAABWAAAATQIAAAIAAAAhCOAAiWMAAAAAAQBVU0QAVVNEACwB-gDxVQ8AK7QBAQUAAQQBLIQApSDbOgAAAAA.%26tt_code%3Dlib_media%26cnd%3D%25215COUcgiRr-QBEKGQgAcYACCJxwEwATgAQABIzQRQuh5YAGDHB2gAcAB4AIABAIgBAJABAZgBAaABAqgBA7ABALkBMzMzMzMz4z_BAUZnlywireE_yQEQs34SiFkBQNkBqaROQBNh8T_gAfa_B-oBAPUBCJxGQA..%26ccd%3D%2521fwUYNQiRr-QBEKGQgAcYiccBIAA.%26udj%3Duf%2528%2527a%2527%252C%2B143712%252C%2B1400515915%2529%253Buf%2528%2527r%2527%252C%2B14682145%252C%2B1400515915%2529%253Bppv%2528180373%252C%2B%25274462914572783588637%2527%252C
Link not recived. But for
url='http://b.photobucket.com/pbkt/hserver/viewid=5870663323/size=RECTANGLE/random=270278/area=lib_media/age=44/gender=M/reg_zip=m6b1h9/username=Aron-in-Toronto/login=Y/cam_make=canon/cam_type=PnS/sp=t/ownername=Aron-in-Toronto/search_kw=empty/ptype=browse/pos=inf/likes=n/spon=empty/adCount=empty/ref_domain=bingcom/feature=/site=pb2/track=empty/anprice=/generic=http%3A%2F%2Fnym1.ib.adnxs.com%2Fab%3Fenc%3DRmeXLCKt4T8Y7XaDPdHfPwAAAAAAABxAGO12gz3R3z9GZ5csIq3hPx0Vro0ode89f4Jy7idho1lLLXpTAAAAADoPAABWAAAATQIAAAIAAAAhCOAAiWMAAAAAAQBVU0QAVVNEACwB-gDxVQ8AK7QBAQUAAQQBLIQApSDbOgAAAAA.%26tt_code%3Dlib_media%26cnd%3D%25215COUcgiRr-QBEKGQgAcYACCJxwEwATgAQABIzQRQuh5YAGDHB2gAcAB4AIABAIgBAJABAZgBAaABAqgBA7ABALkBMzMzMzMz4z_BAUZnlywireE_yQEQs34SiFkBQNkBqaROQBNh8T_gAfa_B-oBAPUBCJxGQA..%26ccd%3D%2521fwUYNQiRr-QBEKGQgAcYiccBIAA.%26udj%3Duf%2528%2527a%2527%252C%2B143712%252C%2B1400515915%2529%253Buf%2528%2527r%2527%252C%2B14682145%252C%2B1400515915%2529%253Bppv%2528180373%252C%2B%25274462914572783588637%2527%252C'
for line in url:
command = "adb shell am broadcast -a ADB_INPUT_TEXT --es msg " + line
print(command)
subprocess.call(command, shell=True)
link inputs
I've seen this app on F-Droid, but it lacks screenshots, changelog and a translatable description there. It's pretty easy for you to add these information. Please have a look at this example or at the F-Droid docs or fastlane docs.
After you have commited these files to your repo and tagged a new version, you need to remove the Description
and Summary
from the metadata file in the F-Droid Data repo.
I haven't had any problems with this app before, so I think my configuration is correct. But recently, I found that when I call the input command in the c language script, the terminal displays "broadcasting: intent {act=adb_input_text (has extras)}", and then does not continue, waiting for the place. But I am sure the adbkeyboard is already open. Sometimes it returns to normal.
I haven't found a solution after searching with google, so I would like to ask if you know where this problem is. thank you very much.
By the way, I installed this app in the bluestacks emulator and ran a c language program in the emulator. The c language used system to call the am command.
To send Ctrl+Space
adb shell am broadcast -a ADB_INPUT_MCODE --eia mcode '4096,62'
what is 4096?
While using IME in typing Japanese or Chinese, there is a candidate text with underline in input box.
Could you please implement this feature for scrcpy users? Thanks.
For reference: https://play.google.com/store/apps/details?id=com.shubhangrathore.xposed.disablefullscreenkeyboard
Dunno why this 'feature' still exists, but it does. Could you add a way to ignore it, if not by default?
Glad to see you've updated the usage of crtl +a. I used crtl +v for replication
i used scrcpy to control my phone
first,i clear the text
adbshellStr = "adb shell am broadcast -a ADB_CLEAR_TEXT" i found this cannot work! donot clear my copyed text in my phone,how does this command mean?
dos send adbshellstr to clear text
then i set something to Clipboard
Clipboard.Clear
Clipboard.setText **something** e:xxdoc
the last i set ctrl+v to coyp sometext to phone textbox
adbshellStr = "am broadcast -a ADB_INPUT_TEXT --es mcode '4096,50' "
dos send adbshellstr
===can ADB_CLEAR_TEXT clear this "ctrl+v "get the text?
but i find my phone can not show something e:xxdoc ,but other work i copyed in my phone
window7 adnroid phone:SM-N9006 4.4.2
adb shell am broadcast -a ADB_INPUT_TEXT --es msg '你好嗎? Hello?'
WARNING:linker:app_process has text relocations.This is wasting menory and is a security risk.Please fix.
Broadcasting: Intent { act=ADB_INPUT_TEXT (has extras) } Broadcast completed: result=0
EditText There is no value
As tested on my latest device, this broadcast seems not working.
But ADB_INPUT_TEXT works for Ascii letters.
So I cannot input unicode characters by now.
It inputs ??? when I tired to display "你好吗“ .But the emoji works.
$ gradle build
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :keyboardservice
Configuration 'compile' in project ':keyboardservice' is deprecated. Use 'implementation' instead.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':keyboardservice'.
> Failed to notify project evaluation listener.
> javax/xml/bind/annotation/XmlSchema
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 12s
Can you advise something?
Need to get and set clipboard text
装了adb输入法执行回车事件没有反应
先执行 adb shell am broadcast -a ADB_INPUT_TEXT --es msg 'Hello' 可以使用
然后执行回车事件搜索 没有反应 adb shell am broadcast -a ADB_INPUT_CODE --ei code 66
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.