You don't need to use the terminal to add the rules. GUFW includes a pre-made rule included in its interface.
See my tutorial here:
Oh and a word of advice. I recently installed KDE Connect on a VM and made the mistake of allowing remote keyboard. This messed up my android keyboard when trying to post on here! So don't select it.