I don't think Appium has a method for that. Appium is getting that using iOS/Android SDK commands.
system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p'
It is same command it just filters device id.
For Android, use ADB commands.
adb devices
command will list devices. Once you get device ID with this command, you can run this command to see all the details including device name, sdk, version
adb -s {deviceID} shell getprop