[General Questions and Answers] 52f1pickup:
Here is my instructions.

If you are reading and attempting to figure out how to gain root access to a Motorola Moto G Play 2023, here is my story. This forum was "extremely" helpful in finding tidbits. I'm an aspiring mobile pentester, looking for a decent Android phone to experiment with. After acquiring older phones and not being fast enough, this phone fits my requirements.

Here are the steps and events, hopefully helping you unlock your Moto G Play 2023:

1. Set up a throwaway account (Gmail, Yahoo).

2.Purchased an unlocked phone from BestBuy for $99 + tax (not tied to a carrier) - Motorola Moto G 2023.

3.Acquired an unlock key from Motorola (which will be used with the fastboot command below). https://en-us.support.motorola.com/app/product_page/faqs/p/11403

4. The OEM unlock feature was grayed out under Developer options. Motorola has an unexplained yet consistent feature to unlock after 7 - 10 days. I configured my phone to connect to Wi-Fi and after about 8 days, the feature became unlocked. https://developer.android.com/studio/debug/dev-options

I spent a few days trying all kinds of things to unlock the grayed-out feature in Developer Options, none of which worked. Patience was needed. There are some threads trying a variety of things, but they didn't work for me.

5. Finding the "boot image" required a Windows machine (Windows 10); my regular machine is a MacBook. On a Windows machine, download "Rescue_and_Smart_Assistant_v6.8.4.13_setup," which will eventually download "boot.img" that will be patched in step above.

6. Download Android Platform tools (ADB, Fastboot), the two tools I used.

7. I needed to "flash" the phone with a 'patched' factory boot image. I used Magisk (https://github.com/topjohnwu/Magisk). Magisk patches (aka roots) the factory boot image that will eventually be flashed on the phone. You'll install Magisk on the phone, copy the boot image from step above to phone /sdcard/downloads is where i put it.

Run the patch command from within Magisk, copy the patched file locally (same folder as platform tools). In Windows, you can either use ADB to copy from /sdcard/downloads or use Windows Explorer.

Checkpoint:

You'll have an unlocked OEM boot-loader option in Developer Options (waited 7 - 10 days).

Magisk installed on the phone (use adb install magisk.apk).

Installed Motorola Rescue and Smart Assistant (download img file anyway) per the post mentioned below on a Windows machine.

Copy boot image to the phone (I use "Platform tools by Android" (ADB)).

Use Magisk to patch the boot.

Copy patched image back to the same folder as ADB / Fastboot (Android platform tools).

8. Hook up the phone via USB to a Windows device.

I followed the linked commands and used commands. One update I needed to use the code, fastboot oem unlock

How to Unlock Bootloader via Fastboot | Step-by-step Guide

Discover a step-by-step guide on how to unlock your device's bootloader using Fastboot. Learn more about what is bootloader and how it works.

gcore.com

9. Type "adb devices" to see if it's authorized, might need to go to Developer options. Once OEM unlock is done, the phone is hooked up to Windows via USB, open command prompt, and type "adb reboot bootloader" no quotes on command line (this will reboot the phone, preparing it for the flash).

10. After phone boots to the bootloader screen, type from the command line:

"fastboot flash boot boot.img" (it can be named whatever and located on the local Windows machine, in the same folder as fastboot).

The flash will cause you to reset the phone as a new phone. I needed to install Magisk again.

Re-attach the phone via USB, enable developer options again, and enable USB debugging.

adb shell

su root (Open Magisk, prompt to authorize elevated to superuser within Magisk) - pic below.

Other tidbits: I downloaded apps from the Google Play Store that I wanted to analyze.

I opened a shell via adb.

Elevated shell to su root.

cp –R /data/app/<whatever path> /sdcard/downloads.

I couldn't copy directly from /data/app as it's owned by system. It looks like there are some one-liners, but I have root access to an Android phone. PS - I didn't use TWRP as there was no image.

Reference links that were helpful

https://xdaforums.com/t/moto-g-play-2023.4563291/

https://xdaforums.com/t/rescue-and-smart-assistant-lmsa-motorola-lenovo-only.3951714/

https://en-us.support.motorola.com/app/standalone/bootloader/unlock-your-device-b

https://gcore.com/learning/how-to-unlock-bootloader-fastboot/ (will need code when typing fastboot unlock command)