2

I have connected my Android mobile phone to my Macbook via ADB. Through ADB shell commands, I have copied a text from an application to the Android's clipboard. Now, I would like to send this copied text (clipboard content) to my connected Macbook through ADB.

I have tried out either directly pasting the clipboard content with service call clipboard 1. However, the result is a Parcel and seems not to contain the clipboard content based on my visual observation.

Moreover, I have thought about pasting the clipboard content to a file inside the mobile phone's internal storage and then sending this file with adb pull command to my Macbook. However, I have not found appropriate commands for this method.

Please note that I also want to keep running the application from which I copied the text on my mobile phone's foreground throughout the whole copy-paste process.

Any thoughts, ideas, or comments are appreciated. Thanks in advance!

1
  • Tasker automation app has Get Clipboard action. It also has File action to save some content into a File. You can combine these two to create a file with clipboard content and then upload the file into your Macbook either using adb or some file sync software. Note: I don't know if Android 11 and above would break this but this definitely can work on Android 10 and lower versions.
    – Firelord
    Feb 2, 2023 at 16:08

0

You must log in to answer this question.

Browse other questions tagged .