Carrier rescan \ reselect for Android

I noticed that when I first booted the Hologram SIM the device scanned a number of carriers, Verizon, ATT, T-Mobile …

Once that was compleated the carrier was set to T-Mobile / Hologram. Is there a programmatic way preferably on the device, to force a rescan and / or specify a different network?

We are using these devices to perform, performance testing against different networks so having devices that can change carriers, rerunning identical tests from the same location is highly valuable.

We are testing with Samsung A10e devices running Android 9.

You can always specify a carrier manually using
AT+COPS=1,2,"######"
command where “######” is the MCCMCN of the carrier you desire.

AT+COPS=?
will give the list of available carriers

Do you have an example code of how I can do think from within an APK ?