For apps that won't launch if USB debugging is enabled, create a shortcut for the app you want to launch and disable USB debugging before launching.
Return USB debugging when the app is closed.
Besides USB debugging, you can also disable developer options.
Please enable it from the settings.
Before using this app, you need to connect to a PC, open a terminal and enter the following command to grant permissions.
adb shell pm grant io.github.takusan23.developerhide android.permission.WRITE_SECURE_SETTINGS
Source code: https://github.com/takusan23/DeveloperHide