0

I got to know how to copy/paste from command line tool at Paste text on Android Emulator

adb shell input keyboard text 'foo'

It works very well for ascii characters but it doesn't for multibyte characters.

adb shell input keyboard text 'あ'

Doesn't pass any character to emulator.

adb shell input keyboard text '\u3042'

Shows '\u3042' as it is.

Is there any way to pass multibyte characters to the emulator from command line correctly?

Community
  • 1
  • 1
Daisuki Honey
  • 157
  • 4
  • 12

2 Answers2

1

I think there is no way to do what you want.

Digging in the sources, the input command line tool ends up calling KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD), and uses that KeyCharacterMap to map from characters to keys press / release events.

Since KeyCharacterMap.VIRTUAL_KEYBOARD does not cover the whole Unicode range, it is not possible to generate events for a lot of characters.

Mihai Nita
  • 5,547
  • 27
  • 27
0

The latest Android Emulator (v25.3) can support copying & pasting multibyte characters. This was launched with Android Studio 2.3. Take a look at the screen recording of the behavior below...

enter image description here

Jamal Eason
  • 6,260
  • 2
  • 19
  • 15