On Xcode 13.1 tried the above scripts. It didn't stop Spotlight when running SwiftUI in a Playground.
Topic:
Community
SubTopic:
Apple Developers
Tags: