Using two different Unos and two different Megas
Are they official Arduino boards or cheap knock-offs?
Cheap knock-offs require drivers, which depends on the USB-to-Serial chip they are using.
For official boards, if the OS doesn’t see them, the IDE doesn’t matter.
Open System Information (Apple Menu > About This Mac > System Report, or use Spotlight.) Look at the USB section. If you don’t see Uno, Mega, or ATmega16u2 listed there, the devices aren’t being enumerated.
No enumeration means bad cable (or data only cable) or the firmware on the ATmega16u2 is corrupted and needs to be reloaded.