Not able to copy+paste in Android emulator with Apple silicon m1
Asked Answered
A

6

27
  • Android emulator API version: 32, arm64-v8a
  • Android studio bumblebee 2021.1.1 patch 3
  • Mac OS version: 12.3.1

I am trying to copy text from emulator and past that text to mac. It was working in intel + android emulator.

Looks like the emulator is not using the mac clipboard.

Alla answered 14/4, 2022 at 12:58 Comment(1)
The problem also exists on Intel macs. The cold boot of the emulator fixed it for me as well. Thank you.Settler
D
57

I had this same issue. It was perplexing. Only one thing worked... a cold restart of the emulator.

Diagnosing

Check if copying/pasting text works at all to/from host and emulator:

  1. Open a search box on the emulator (or any EditText)
  2. Type some text, select it and copy, then paste
  3. Try from your host machine to the emulator, from the emulator to your host machine, and just on the emulator itself

For me, pasting did not work from host -> device and it didn't work from device -> host it also did not work on device, itself!

Solution

The only solution was to close the emulator and re-open it using "Cold boot now" as pictured

enter image description here

Diversification answered 12/5, 2022 at 14:47 Comment(0)
J
20

I actually found a solution, right now working on a MacBook Pro 16 2021 M1 Max

Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.1
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 10
Registry: external.system.auto.import.disabled=true

What you basically have to do is to enable the copy first on a text inside the emulator and then all the copy and past functionality will be available outside the emulator.

  • Enable clipboard functionality on the keyboard
  • Copy a random text inside the emulator

After doing these steps copy any other things on Mac OS and you will see the text inside the copied text inside the clipboard

Joel answered 1/2, 2023 at 14:58 Comment(2)
Actually solved my issue, it was working before, created new emulator and it broke. Thanks.Sigman
Perfect! Worked for me as well.Kilgore
S
2

Problem

this thing suddenly doesnt show on my emulator

enter image description here

Solution

I fix it by using cold boot now, this solved my issue on M1 macbook

enter image description here

Shuttering answered 25/7, 2023 at 7:16 Comment(0)
H
0

Most likely, the emulator is copying the text to the Android Clipboard (usually set to Gboard by default). Another possibility is the android emulator doesn't recognize the cmd key on an apple keyboard the same way as a ctrl key on a normal keyboard.

Check this forum out to see if it has any solutions. In the case that it doesn't There are a few things I would try first - one of which is look for a third party app that will automatically sync clipboard between Mac and Android. Here is one that works for Windows (probably the best solution if it also works for Mac)

Alternatively, you could real quickly throw together an apk that grabs clipboard data, and sends it over. You could viably do this pretty quickly using react native. Have it detect clipboard text, and send it over localhost (probably tcp) using websockets. Most programming languages can connect and receive over tcp, so you could use your choice language to connect and read the data.

Harmonist answered 24/4, 2022 at 1:3 Comment(2)
None of you solutions are working. emulator clipboard is not synced with Macs clipboard.Alla
@Alla try looking at your keyboard settings in ~/.android/avd/<The_Device_Name>/config.iniHarmonist
D
0

on mac you have to long press in the emulator than you can paste

Deryl answered 24/4, 2022 at 19:18 Comment(1)
This is already tested and then I posted question in stackoverflow. Your steps are not working. At your end it may be working because of your hardware configurations are differentAlla
S
0

Have the exact same issue with the M1. Try Scrcpy. For me it works with copying and pasting. First you have to start the emulator and then copy it with scrcpy.

I didn't find a way to hide the emulator, it always opens with a window. This is different from its behaviour under Windows, where you can let the emulator run in the background. I've tried minimizing the emulator, but unfortunately the emulator window sometimes randomly reappears. The scrcpy window is also quite slow for me.

Sacrilege answered 26/10, 2022 at 9:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.