adb shell setprop ro.product.model "Google Pixel 6 Pro"
This may brick your device if done incorrectly. Only attempt if you are comfortable with command-line recovery. how to edit build.prop without unlocking bootloader
If your device has specific vulnerabilities, you might use these "bootless" methods that do not require a permanent bootloader unlock: MTK Easy SU (MediaTek Devices Only): adb shell setprop ro