Leonardo doesn't detected anymore

By some reason I can’t connect to my Leonardo on macbook.

When I press “reboot” button I see the device is connected to usb in Arduino IDE in the dropdown (led is blinking on the board), but once it is rebooted it disappears form the dropdown list.

Any way to return it to work?

Many thanks!

Start an upload of an innocent sketch (e.g. blink).
When the IDE reports the memory usage, tap the reset button.
Upload should succeed.

If you can't select a port in the IDE, tap the reset button and select that port.

The problem is caused by your sketch.

Wow, man! Thank you so much! It must be here: https://support.arduino.cc/hc/en-us/articles/4412955149586-If-your-board-is-not-detected-by-Arduino-IDE

Really!

It actually is :wink: Under Try a bootloader reset if your board supports it; but the Leonardo and Micro are not specifically mentioned.

Note that on a Leonardo a single tap on the reset is (as done above) sufficient.

not really, I red that point before asking here, but your trick is rewrite the code during this process. so your solution is very smart and tricky, anyway I returned my board to life and happy with it :wink: tanks!