Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
ee3055a
Update README.md
Poussinou Sep 16, 2018
047ea2f
Update README.md
senzhk Jan 6, 2020
3e88fdb
Update README.md
senzhk Jan 6, 2020
5205540
Add new method to send Meta key state
Apr 18, 2020
3e16825
Merge pull request #35 from ailin-nemui/meta-keycodes
senzhk May 30, 2020
45835fb
Merge pull request #19 from Poussinou/patch-1
senzhk May 30, 2020
c08c30f
Update sunshinewithmoonlight script.
senzhk May 30, 2020
df7e199
adding adb command to clear all text
senzhk Jun 20, 2020
e50bb40
Update README.md
senzhk Jun 20, 2020
933eb69
delete old apk
senzhk Jun 20, 2020
819acf9
new debug apk
senzhk Jun 20, 2020
90749e4
Update README.md
senzhk Jun 20, 2020
7bddbe5
fix gradle build
senzhk Sep 5, 2020
9a87473
Create android.yml
TSaltedfishKing Aug 10, 2021
90db9a5
Update android.yml
TSaltedfishKing Aug 12, 2021
6e36d88
Update android.yml
TSaltedfishKing Aug 12, 2021
dfccc11
Update android.yml
TSaltedfishKing Aug 12, 2021
42157db
Update android.yml
TSaltedfishKing Aug 12, 2021
129a82f
Merge pull request #45 from TSaltedfishKing/master
senzhk Aug 12, 2021
2fe2293
add info about enable and reset from CLI
alexcohn Sep 6, 2022
f7ab7dc
fix issues with sending meta key code
sinh15071997 Sep 16, 2022
c830b31
update apk and readme
sinh15071997 Sep 16, 2022
480182f
Merge pull request #48 from alexcohn/master
senzhk Oct 9, 2022
793699b
Merge pull request #50 from truong0vanchien/master
senzhk Oct 9, 2022
195ac32
change pipe to plus sign for two meta inputs
senzhk Oct 9, 2022
804a77c
Update README.md
senzhk Oct 9, 2022
ad86b55
remove adhoc release in root dir, moved to github release
senzhk Oct 9, 2022
1094d97
Merge branch 'master' of https://github.com/senzhk/ADBKeyboard
senzhk Oct 9, 2022
4f75ce4
Update README.md
senzhk Oct 9, 2022
a98a425
rollback
senzhk Oct 9, 2022
401a912
Merge branch 'master' of https://github.com/senzhk/ADBKeyboard
senzhk Oct 9, 2022
6f220f4
Update android.yml
senzhk Oct 9, 2022
4ae7b37
Update android.yml
senzhk Oct 9, 2022
8ca1829
Update android.yml
senzhk Oct 9, 2022
5ab1324
Update android.yml
senzhk Oct 9, 2022
402de3e
Update android.yml
senzhk Oct 9, 2022
10d3b4a
Update android.yml
senzhk Oct 9, 2022
9c1c0c3
Update AdbIME.java
senzhk Oct 9, 2022
3498268
Update android.yml
senzhk Oct 9, 2022
9b9904d
Update android.yml
senzhk Oct 9, 2022
989797d
new apk
senzhk Oct 9, 2022
4acf078
Merge branch 'master' of https://github.com/senzhk/ADBKeyboard
senzhk Oct 9, 2022
5bb9d35
Update README.md
senzhk Oct 9, 2022
7375d42
update sdk
senzhk Nov 22, 2023
5cbf32c
new apk for new OS vers
senzhk Nov 22, 2023
8dd0b69
fix the meta flow broke the normal msg flow.
senzhk Nov 23, 2023
96c0422
fix mcode
senzhk Nov 23, 2023
9466caa
Update README.md
senzhk Nov 23, 2023
793740a
Add IME action shortcuts for search, go, done, next, and send
hongwen000 Dec 3, 2025
2931f1c
Update Gradle configuration and AndroidManifest for compatibility
hongwen000 Dec 3, 2025
480be4f
Fix crash during IME_CLEAR_TEXT
hongwen000 Dec 24, 2025
d7a4505
Merge pull request #77 from dqtz5vpvj9-create/master
senzhk Jan 10, 2026
f05286a
fix the build error
senzhk Jan 10, 2026
d083620
Merge pull request #81 from senzhk/dev
senzhk Jan 10, 2026
efceadf
Update android.yml
senzhk Jan 10, 2026
1c592bd
Update android.yml
senzhk Jan 10, 2026
98dc653
fixing workflow to generate release apk
senzhk Jan 10, 2026
7932242
Update README.md - new latest apk
senzhk Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Android CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [published, created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Build Debug APK
run: ./gradlew assembleDebug

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: "**/build/outputs/apk/debug/*.apk"

- name: Create Release and Upload APK
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: "**/build/outputs/apk/debug/*.apk"
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file modified ADBKeyboard.apk
Binary file not shown.
47 changes: 44 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ is not going to work.

ADBKeyboard will help in these cases, especially in device automation and testings.

Download APK from release page
---------------------
* [Dev] Latest APK download: [https://github.com/senzhk/ADBKeyBoard/releases/download/v2.4-dev/keyboardservice-debug.apk]
* [Old] Release APK download: [https://github.com/senzhk/ADBKeyBoard/blob/master/ADBKeyboard.apk]

Build and install APK
---------------------

Expand All @@ -36,7 +41,12 @@ With one device or emulator connected, use these simple steps to install the key
How to Use
----------

* Enable 'ADBKeyBoard' in the Language&Input Settings.
* Enable 'ADBKeyBoard' in the Language&Input Settings OR from adb.
```
adb install ADBKeyboard.apk
adb shell ime enable com.android.adbkeyboard/.AdbIME
adb shell ime set com.android.adbkeyboard/.AdbIME
```
* Set it as Default Keyboard OR Select it as the current input method of certain EditText view.
* Sending Broadcast intent via Adb or your Android Services/Apps.

Expand All @@ -48,9 +58,19 @@ adb shell am broadcast -a ADB_INPUT_TEXT --es msg '你好嗎? Hello?'
* This may not work for Oreo/P, am/adb command seems not accept utf-8 text string anymore

1.1 Sending text input (base64) if (1) is not working.
adb shell am broadcast -a ADB_INPUT_B64 --es msg `echo '你好嗎? Hello?' | base64`

* You can use the latest base64 input type (together with Mac OS X/Linux's base64 command):
* For Mac/Linux, you can use the latest base64 input type with base64 command line tool:
adb shell am broadcast -a ADB_INPUT_B64 --es msg `echo -n '你好嗎? Hello?' | base64`

* For Windows, please try this script (provided by ssddi456):
https://gist.github.com/ssddi456/889d5e8a2571a33e8fcd0ff6f1288291

* Sample python script to send b64 codes (provided by sunshinewithmoonlight):
import os
import base64
chars = '的广告'
charsb64 = str(base64.b64encode(chars.encode('utf-8')))[1:]
os.system("adb shell am broadcast -a ADB_INPUT_B64 --es msg %s" %charsb64)

2. Sending keyevent code (67 = KEYCODE_DEL)
adb shell am broadcast -a ADB_INPUT_CODE --ei code 67
Expand All @@ -61,6 +81,22 @@ adb shell am broadcast -a ADB_EDITOR_CODE --ei code 2
4. Sending unicode characters
To send 😸 Cat
adb shell am broadcast -a ADB_INPUT_CHARS --eia chars '128568,32,67,97,116'

5. Send meta keys
To 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.


6. CLEAR all text (starting from v2.0)
adb shell am broadcast -a ADB_CLEAR_TEXT

</pre>

Enable ADBKeyBoard from adb :
<pre>
adb shell ime enable com.android.adbkeyboard/.AdbIME
</pre>

Switch to ADBKeyBoard from adb (by [robertio](https://github.com/robertio)) :
Expand All @@ -78,6 +114,11 @@ Check your available virtual keyboards:
adb shell ime list -a
</pre>

Reset to default, don't care which keyboard was chosen before switch:
<pre>
adb shell ime reset
</pre>

You can try the apk with my debug build: https://github.com/senzhk/ADBKeyBoard/raw/master/ADBKeyboard.apk

KeyEvent Code Ref: http://developer.android.com/reference/android/view/KeyEvent.html
Expand Down
15 changes: 13 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
buildscript {
repositories {
jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:8.1.0'
}
}

allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
google()
mavenCentral()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Oct 14 18:04:03 HKT 2018
#Wed Dec 03 11:08:02 CST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
14 changes: 7 additions & 7 deletions keyboardservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '28.0.3'
namespace 'com.android.adbkeyboard'
compileSdk 33

defaultConfig {
applicationId 'com.android.adbkeyboard'
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
minSdk 21
targetSdk 33
versionCode 2
versionName "2.0"
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
2 changes: 1 addition & 1 deletion keyboardservice/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.adbkeyboard"
android:versionCode="1"
android:versionName="1.0" >

Expand All @@ -12,6 +11,7 @@
<!-- Declares the input method service -->
<service android:name="AdbIME"
android:label="@string/keyboard_name"
android:exported="false"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
Expand Down
Loading