Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2021.1.X



Found in


Issue ID




[iOS] " Permission denied" when building Xcode project built from Windows directly to a macOS shared folder



Reproduction steps:
1. Build an empty iOS project from a Windows machine directly to a shared macOS folder.
- Use build pipeline script to build the project (Default builder in the Build Settings doesn't work for the network builds). You can check the attached script, named 't.cs' as a reference.
- Make sure macOS shared folder is configured to be accessed from a Windows machine.
2. Open and try to build the built Xcode project.

Actual behavior:
- Build fails with " Permission denied" error message.

  1. Resolution Note (fix version 2021.2):

    MapFileParser will be removed from 2021.1+ version
    For earlier versions:
    By default SMB configuration on Mac device does not allow to set an executable flag for security reasons.
    One way to work around this is to make Xcode to set it for you.
    Open generated Xcode project go to UnityFramework target / Build Phases / Run Script
    at line 1 add: chmod +x "$PROJECT_DIR/"
    line 2 of what it was on line 1: "$PROJECT_DIR/"

    you can do it:
    - manually
    - with BuildPostProcessor via PBXProject API
    - or if you want to make this change for all iOS/tvOS generated projects change Unity-iPhone.xcodeproj in your Unity Editor installation for iOS/tvOS platform support modules Trampoline folder

    p.s. In order to build directly to Mac shared folder you can Map Network Drive on windows and use it as target to Generate Xcode project.

Comments (3)

  1. rawlypete

    Dec 08, 2021 10:52

    I encountered this Error for the first time yesterday. I'm still using 2020.3 as my production build. The manifestation is slightly different, perhaps someone could explain it. It's not a show stopper as I only uncovered it when finally being invited into Apples XCode Cloud Beta, and so for the first time I needed to push my iOS build folder into Bitbucket, as XCode Cloud requires a repository.

    My Normal Workflow Steps into XCode:

    1) Master my Project on Windows 10 in Unit 2020.3.
    2) When testing for iOS, Build it into a folder on PC.
    3) On Mac I copy the entire folder from the PC to Mac
    4) Open the Project in XCode, and everything 'Builds' without an Errors.

    Workflow I used yesterday when using a Bit Bucket Repository for testing out XCode Cloud:

    1) Master my Project on Windows 10 in Unit 2020.3.
    2) When testing for iOS, Build it into a folder on PC.
    3) From PC, upload my build iOS Folder into Bitbucket repository.
    4) From XCode using "Clone an Existing Project" - select the Bitbucket as above and when building Error:

    " Permission Denied...... etc...."

    I'm sure the workaround above will work on my local Mac, although not sure how this will affect the XCode Cloud Workflow as I've not got that far yet, and I'm guessing it relies on the original repository to work.

  2. krupps

    Jun 06, 2021 15:35

    This is not fixed with the latest LTS

  3. MaskedMouse

    Oct 12, 2018 07:19

    This issue has been there for ages. You can fix it by using chmod +x /path/to/MapFileParser via the terminal.
    We've made an automator task for this so we can just right click the folder and let it use chmod on all .sh files.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.