Add serialPort preference and improve MacOs specific path computation