Xcode error 'not a valid path to an executable file' when I try to run on physical device

In Xcode, I'm trying to run my code on a physical iPhone 12. The project builds correctly but then I get an error: "Executable path is a Directory" MyProject.app is not a valid path to an executable file.

I suspect that the architecture might wrong. I'm using:

//:configuration = Debug
VALID_ARCHS = armv7 armv7sarm64 arm64e armv7 armv7s x86_64

//:configuration = Release
VALID_ARCHS = armv7 armv7sarm64 arm64e armv7 armv7s x86_64

I can successfully run in the simulator with the iPhone 12 simulator I using Xcode 14.3.1.

Any thoughts?

Fixed it. I deleted my custom architecture string and reverted back to the default values. Problems fixed exceopt it wont run on my simulator unless I put back the modified string.

I have the same issue when I run the app on iOS Simulator after updating to app to make it compatible with Xcode-16 and iOS-18. after upgradation its giving the above error This app work fine on Xcode-15 .

Note - The issue with iOS Simulator only. From XCode-16 build is created successfully and installed in iOS device.

Xcode error 'not a valid path to an executable file' when I try to run on physical device
 
 
Q