XCode issue with iOS app running on macos since MacOS 14.4

Hi, I encountered a very strange issue. I believe it happened following MacOS 14.4 upgrade, I tested and could reproduce systematically the following behaviour both in XCode 15.2 & 15.3 on my macbook air m2.

If you build an iOS app and compile it to run on MacOS (m1) using "My Mac (Designed for iPad) target, only the 2 first builds will be ok. From 3rd one, any code change will build correctly but not be taken into account.

I found that cleaning the .XCInstall in the build folder (where the MacOS package is deployed), it works ok (adding rm -fr ${BUILT_PRODUCTS_DIR}/.XCInstall as pre-build script).

Step to reproduce: create a iOS new app (just initiate a new project, I choosed an objective-C one with storyboard) and build it with target "My Mac (Designed for iPad)". Lets say the app is named "test.app". 1st build, it will build as "test.app" in build/.XCInstall folder: ok 2nd build, it will build as "test.app 2" in build/.XCInstall folder: ok 3rd build, it will build as "test.app 3" in build/.XCInstall folder: KO, any code change won't be taken into account (as if I was running "test.app 2"). It will require to clean the project to make it work again (and so next build will generate "test.app" and not "test.app 4").

This caused a very frustrating few hours for me, I found that moving the .XCInstall apps into the Bin didn't work, but deleting them completely does.

any reply/update from xcode dev please ? would be useful to have a long term fix

I thought it was just me and I was seeing things... I'm currently on 14.4.1 and the issue still persists.

Try to set DEPLOYMENT_LOCATION to YES in Build Setting.

Changing DEPLOYMENT_LOCATION doesn't work. For now I blame MacOS container manager. I can modify some string in the build, run the app and observe that during execution I still see the old string. Then I navigate to XCInstall within DerivedData or within /private/tmp/MyApp.dst/Applications/ (if DEPLOYMENT_LOCATION to YES) and confirm that the string within the build is correct (new). Then I can run the build directly from the Finder from XCInstall and the behavior is still old. But if I copy the build to a different directory and run from there, the behavior is new! I.e. I see the new string.

If I do "Clean build folder..." (Cmd-Shift-K) the app runs with the recent changes, but build time is much greater, as XCode does the full build.

Very annoying... Debugging on real iPhone is much slower in my case, but it seems I'm forced to do it that way :(

XCode issue with iOS app running on macos since MacOS 14.4
 
 
Q