There's no TestFlight-specific icon setting that I know of: TestFlight just distributes whatever build configuration you archive, so the usual trick is a third configuration.
Project > Info > Configurations: duplicate Release as "Beta".
Build Settings > Primary App Icon Set Name (ASSETCATALOG_COMPILER_APPICON_NAME): Debug = AppIcon-Development, Beta = AppIcon-Beta, Release = AppIcon.
Edit Scheme > Archive > Build Configuration: Beta when you want a TestFlight beta build, Release for the App Store build (or keep two schemes, one per channel).
Keep the bundle ID/display name in mind too if you want builds installed side by side.
Disclosure: I made a small open-source CLI, blueprint, that turns an .icon (or .appiconset) into an Xcode-beta-style blueprint version for Debug builds, so you never open the wrong build. It needs macOS 14+ and Xcode 26+. It isn't needed for the steps above, but might save you drawing the Debug variant: https://github.com/MustafaNatur/blueprint
Topic:
App Store Distribution & Marketing
SubTopic:
TestFlight
Tags: