[Samsung Galaxy A32 5G] GalaxyA325G:
Here is how to mirror the phone on the desktop over USB or over Wi-Fi using the FOSS scrcpy software.

1. Read the FOSS scrcpy readme explanatory file.

[https://github.com/Genymobile/scrcpy#readme]

The two fundamental steps are

C:\> adb devices

(That should report the adb-name-of-your-android-device.)

C:\> scrcpy -s adb-name-of-your-android-device

(That should mirror your phone onto the PC over USB or Wi-Fi.)

2. Download both the adb & scrcpy commands from this zip file.

[https://github.com/Genymobile/scrcpy]

Note that you can use any adb from anywhere so if you already have adb from Android Studio, then use that if you want to.

3. Turn on USB Debugging & default mode is file transfer.

4. Connect your Galaxy A32-5G to the PC over the USB cable.

The notifications should say "USB for file transfer".

5. For this test, I purposefully turned off Wi-Fi on the phone so that the connection would only be via USB cable.

6. If necessary install Windows drivers to ensure the phone shows up as "Galaxy A32 5G" on the Windows network.

6. Run the adb daemon and obtain your device name over USB.

C:\> adb devices

You should see something like:

ABCD##ABCDE device

x. Run scrcpy to mirror the device onto your Windows 10 PC.

C:\> scrcpy -s ABCD##ABCDE

Where the "1ABCD##ABCDE" is the unique name as reported by adb but if you only had one device connected to the adb daemon, you don't even need that '-s' option; yet it's a good habit to use it.

At this point all the following work seamlessly together

Your PC will show what's on your phone screen.

Your PC mouse will manipulate your phone screen.

Your PC keyboard will type into your phone screen.

Your PC & Android clipboards will be interchangeable.\

Here are some useful things you can do with scrcpy.

To take a movie of the entire session (on either USB or over Wi-Fi):

C:\> scrcpy --record foo.mp4

C:\> scrcpy -r bar.mkv

To perfectly screenshot just the phone window on demand in Windows:

C:\> Irfanview

Irfanview:Options/Capture Screenshot > (o)Foreground window - Client area

File name: capture_$U(%Y%m%d_%H%M%S)_###

(Or you can automatically capture every half second or whatever)

DETAILS:

1. Install adb on Windows as per instructions here.

<https://www.xda-developers.com/install-adb-windows-macos-linux/>

<https://dl.google.com/android/repository/platform-tools-latest-windows.zip>

<https://dl.google.com/android/repository/platform-tools_r31.0.3-windows.zip>

Note you do not need to be root on the phone nor admin on the Windows PC.

Note: You can skip this step if you ONLY want to run scrcpy as

scrcpy comes with its own adb which works fine for that purpose.

2. On the phone, check if you have Developer Mode turned on.

Settings > About phone > Software information > Build number

If you tap once & it says "Developer mode has already been turned on"

then you don't need to tap it 7 times to turn Developer Mode on.

3. On the phone, enable the USB Debugging mode option.

Settings > Developer options > USB debugging = on

4. Connect your phone via USB to the PC & run a quick test.

C:\> adb devices

On Windows you will see some debugging information:

* daemon not running; starting now at tcp:55555

* daemon started successfully

List of devices attached

ABCD##ABCDE unauthorized

On your phone’s screen, you should see a prompt to allow or deny USB Debugging access which you should grant permanently for this computer so that when the screen is broken, it will still connect!

Grant USB Debugging access when prompted (and tap the always-allow check box if you want).

Then run the command again:

C:\> adb devices

List of devices attached

ABCD##ABCDE device

5. From the PC you should now be able to access even the phone root filesystem.

Optional test:

C:\> adb pull /system/etc/hosts .\hosts.txt

[That should copy the Android hosts file over to your Windows machine.]

Find the number of packages you have which have "google" in the name.

C:\> adb shell pm list packages google | find /c /v ""

6. And from the PC, you should now be able to bring up Android Activities.

Optional teset:

Bring up the gms "Reset AD ID" Activity on Android from Windows:

C:\> adb shell am start -n com.google.android.gms/.ads.settings.AdsSettingsActivity

That should pop up the "Reset AD ID" settings page on your phone.

[GMS is a set of "google mobile services" products native on Android.]

You can close that page on Android from Windows by running this:

C:\> adb shell am force-stop com.google.android.gms

Which you can put into a "closegms.bat" one-line file for convenience.

7. Obtain the Windows "Screen Copy" code to mirror the Android screen.

<https://www.khalidalnajjar.com/take-screenshots-of-secure-conversations-on-android/>

<https://github.com/Genymobile/scrcpy>

Save to C:\installer\editor\android\scrcpy\scrcpy-win64-v1.23.zip

Name: scrcpy-win64-v1.23.zip

Size: 35446869 bytes (33 MiB)

SHA256: D2F601B1D0157FAF65153D8A093D827FD65AEC5D5842D677AC86FB2B5B7704CC

Extract to C:\app\editor\android\scrcpy

Note there is an adb.exe which comes with that zip file

You can now interact with your phone using the Windows kebyoard & mouse

11. To record a mirrored Android session as an MP4 video run this:

C:\> scrcpy --record file.mp4

C:\app\editor\android\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 1.4 MB/s (41123 bytes in 0.027s)

[server] INFO: Device: samsung SM-A326U (Android 11)

INFO: Renderer: direct3d

INFO: Initial texture: 720x1600

INFO: Recording started to mp4 file: file.mp4

Note you can press control+c to end the recording when desired.

14. If desired, use the TCP/IP Wi-Fi connection between Windows & Android which requires the USB connection first, and then you can disconnect after establishing the Wi-Fi connection.

C:\> adb connect 192.168.1.2:5555

Where 191.168.1.2 is the IP address of your phone on your LAN.

C:\> scrcpy

Or you can establish the Wi-Fi connection from the start but this always requires interacting with the screen first.

(WORK IN PROGRESS TO ADD THESE STEPS.)

I do this all the time so I just need to document it.