Serial ports

Hi guys,

When I use echo ‘5’ > /dev/cu.usbmodem1431 on MacOS, Arduino reboots and nothing happens.
How fix it?

What version of MacOS? What USB serial adapter is it?

Which board?

Most Arduinos (e.g. Uno, Nano, Mega) reset when you open the serial port; exceptions are those with native USB (e.g. Leonardo and Micro).

The reset is needed to activate the bootloader; there is a track on the board that you can cut to prevent this from happening but that will make code uploads more difficult.