Here is another way to add a Mazda CX-30/CX-5/M6/M8 etc 6A smart key with Xhorse tools without connecting to car.
How to copy Mazda 6A smart key with Xhorse key tool (Key tool max, key tool max pro, key tool plus) and Xhorse universal remote key.?
This requires an original or working key. So add key only.
First, generate the right key with the ID6A.
Go to Vehicle Remote- Mazda.
Generate ID6A remote using xhorse smart remote.
Then clone remote using xhorse xm38.
Go to Special Function-> Copy Proximity Remote->Mazda 6A smart key clone
Follow prompts to collect original key data and write new key.