Unity 2021.3 or higher. Just press the Add Component button on any GameObject that has a Rect Transform and select Safe Area Fitter.
Allows you to set the anchor presets in code, with the same results you'd get messing with the Rect Transform's inspector controls. How to use: 1 - Import the test project unity package, at least the ...