Paste text on Android Emulator

2019-01-16 00:13发布

Is there anyway to copy/paste (desktop's) clipboard content to EditView on Android Emulator?

(just for the sake to ease development/test)

17条回答
何必那么认真
2楼-- · 2019-01-16 00:40

If you are using Android Studio on a Mac, you may need to provide the full path to the adb executable. To find this path, open:

Android Studio > Tools > Android > SDK Manager

Copy the path to the SDK location. The adb executable will be within a platform-tools directory. For me, this was the path:

~/Library/Android/sdk/platform-tools/adb

Now you can run this command:

~/Library/Android/sdk/platform-tools/adb shell input text 'thetextyouwanttopaste'
查看更多
Fickle 薄情
3楼-- · 2019-01-16 00:43

Using Visual Studio Emulator, Here's my method.

First Mound a virtual sd card:

  1. Use the Additional Tools (small >> icon) for the emulator and go to the SD Card tab.
  2. Select a folder on your computer to sync with the virtual SD card.
  3. Pull from SD card, which will create a folder structure on the selected folder.

Set up a text file to transfer text:

  1. Use Google Play Store to install a text editor of your choice
  2. Create a text file containing your text on you computer in the download directory of the virtual sd card directory you created before.

Whenever I need to send text to the clip board.

  1. Edit the text file created above.
  2. Go to Additional Tools (small >> icon) and chose Push To SD Card.
  3. Open the text file in the text editor I installed and copy the text to the clip board. (Hold down the mouse when the dialog opens, choose select all and then click the copy icon)

Once set up it pretty easy to repeat. The same method would be applicable to other emulators by you may need to use a different method to push your text file to emulator.

查看更多
Anthone
4楼-- · 2019-01-16 00:45

You can do this without workarounds too. Just click and hold for a bit in the input field till the paste notification appears and then click on paste. That's it!

查看更多
\"骚年 ilove
5楼-- · 2019-01-16 00:46

Write command: adb devices (it will list the device currently connected) Select Textbox where you want to write text. Write command: adb shell input text "Yourtext" (make sure only one device is connected to run this command) Done!

查看更多
放我归山
6楼-- · 2019-01-16 00:46

Made this Windows application that allows users to copy paste to Android emulators or connected devices from a visual interface. https://github.com/Florin-Birgu/Android-Copy-Paste

enter image description here

查看更多
登录 后发表回答