iOS Xcode 15 Sandbox: rsync(xxxx) deny(1) file-write-create

Question

After creating a new project in Xcode and pod install, I encountered the following problem when running:

Showing Recent Errors Only
PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build/Script-E88C34EA17BFA0AB57 02C3F2.sh (in target 'FoundationPodTest' from project 'FoundationPodTest')
    cd /Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest
    /usr/bin/sandbox-exec -D SCRIPT_OUTPUT_FILE_0\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework -D SCRIPT_OUTPUT_FILE _1 \ =/Users/Liyazhu/Library/Developer/XCode/DerivedData/FoundationPodtest-FZQIALISKZIQAAJUZEODFPLVYRD/Build/Produg-iPhonesimu Lastor/FoundationPodtest.app/Frameworks/Hyyfoundation.framework -D Script_output_file_2 \ =/Users/Library/Developer/Developer/Developer/Developer/Developer/Developer Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/KVOController.framework -D SCRIPT_OUTPUT_FILE_3\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqial iskgziqaajuzeodfplvyrd/Build/Products /Debug-iphonesimulator/FoundationPodTest.app/Frameworks/YYCategories.framework -D SCRIPT_INPUT_FILE_0\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods/Target\ Support\ Files/Pods-FoundationPodTest/Pods-FoundationPodTest-frameworks- Debug-input-files.xcfilelist -D SCRIPT_INPUT_FILE_1\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods/Target\ Support\ Files/Pods-FoundationPodTest/Pods-FoundationPodTest-frameworks-Debug-output-files.xcfilelist -D SCRIPT_INPUT_FILE_2\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods/Target\ Support\ Files/Pods-FoundationPodTest/Pods-FoundationPodTest-frameworks.sh -D SCRIPT_INPUT_FILE_3\=/Users/liyazhu/Library/Developer /Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FMDB/FMDB.framework -D SCRIPT_INPUT_FILE_4\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd /Build/Products/Debug- iphonesimulator/HYYFoundation/HYYFoundation.framework -D SCRIPT_INPUT_FILE_5\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/KVOController/KVOController.framework -D SC RIPT_INPUT_FILE_6\=/Users/ liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/YYCategories/YYCategories.framework -D SCRIPT_INPUT_FILE_7\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPod Test-fzqialiskgziqaajuzeodfplvyrd/Build /Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build/InputFileList-E88C34EA17BFA0AB5702C3F2-Pods-FoundationPodTest-frameworks-Debug-input-files-ea8abfaa884cbbf6a8bba06e1644990a-resolved.xcfilelist -D SCRIPT_INPUT_FILE_8\=/Users/liyazhu/Library/ Developer / e50913a89662a9a9d6a0f9bc3f7dabaa-resolved.xcfilelist - D SCRIPT_INPUT_FILE_9\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build/Script-E88C34EA17BFA0AB5702C3 F2.sh -D SCRIPT_INPUT_ANCESTOR_0\=/ -D SCRIPT_INPUT_ANCESTOR_1\=/Users -D SCRIPT_INPUT_ANCESTOR_2\=/Users/liyazhu -D SCRIPT_INPUT_ANCESTOR_3\=/Users/liyazhu/Desktop -D SCRIPT_INPUT_ANCESTOR_4\=/Users/liyazhu/Desktop/Demo -D SCRIPT_INPUT_ANCESTOR_ 5\=/Users/liyazhu/ Desktop/Demo/FoundationPodTest -D SCRIPT_INPUT_ANCESTOR_6\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest -D SCRIPT_INPUT_ANCESTOR_7\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods -D SCRIPT_INPUT_ANCESTOR_ 8\=/Users/liyazhu /Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods/Target\ Support\ Files -D SCRIPT_INPUT_ANCESTOR_9\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest/Pods/Target\ Support\ Files/Pods-FoundationPodTest -D SCRIPT_INPUT_ANCESTOR_10\= /Users/liyazhu/Library -D SCRIPT_INPUT_ANCESTOR_11\=/Users/liyazhu/Library/Developer -D SCRIPT_INPUT_ANCESTOR_12\=/Users/liyazhu/Library/Developer/Xcode -D SCRIPT_INPUT_ANCESTOR_13\=/Users/liyazhu/Library/Developer/Xcode/ DerivedData -D SCRIPT_INPUT_ANCESTOR_14\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd -D SCRIPT_INPUT_ANCESTOR_15\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzq ialiskgziqaajuzeodfplvyrd/Build -D SCRIPT_INPUT_ANCESTOR_16\= /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex -D SCRIPT_INPUT_ANCESTOR_17\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodf plvyrd/Build/Intermediates.noindex/ FoundationPodTest.build -D SCRIPT_INPUT_ANCESTOR_18\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator -D SCRIPT_INPUT_ANCESTOR_19\=/Users /liyazhu/Library/ Developer / qialiskgziqaajuzeodfplvyrd/Build /Products -D SCRIPT_INPUT_ANCESTOR_21\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator -D SCRIPT_INPUT_ANCESTOR_22\=/Users/liyazhu/Library/Developer/X code/DerivedData/FoundationPodTest -fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FMDB -D SCRIPT_INPUT_ANCESTOR_23\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/H YYFoundation -D SCRIPT_INPUT_ANCESTOR_24\=/Users /liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/KVOController -D SCRIPT_INPUT_ANCESTOR_25\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialis kgziqaajuzeodfplvyrd/Build/Products/ Debug-iphonesimulator/YYCategories -D SCRIPT_OUTPUT_ANCESTOR_0\=/ -D SCRIPT_OUTPUT_ANCESTOR_1\=/Users -D SCRIPT_OUTPUT_ANCESTOR_2\=/Users/liyazhu -D SCRIPT_OUTPUT_ANCESTOR_3\=/Users/liyazhu/Library -D SCRIPT_OUTPUT_ANCESTOR_ 4\=/Users/liyazhu/Library/ Developer -D SCRIPT_OUTPUT_ANCESTOR_5\=/Users/liyazhu/Library/Developer/Xcode -D SCRIPT_OUTPUT_ANCESTOR_6\=/Users/liyazhu/Library/Developer/Xcode/DerivedData -D SCRIPT_OUTPUT_ANCESTOR_7\=/Users/liyazhu/Library/Developer/Xcode/DerivedData /FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd -D SCRIPT_OUTPUT_ANCESTOR_8\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build -D SCRIPT_OUTPUT_ANCESTOR_9\=/Users/liyazhu/Libr ary/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build /Products -D SCRIPT_OUTPUT_ANCESTOR_10\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator -D SCRIPT_OUTPUT_ANCESTOR_11\=/Users/liyazhu/Library/Developer/X code/DerivedData/FoundationPodTest -fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app -D SCRIPT_OUTPUT_ANCESTOR_12\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-i phonesimulator/FoundationPodTest.app/Frameworks - D SRCROOT\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest -D PROJECT_DIR\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest -D OBJROOT\=/Users/liyazhu/Library/Developer/Xcode/DerivedData /FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex -D SYMROOT\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products -D DSTROOT\=/tmp/FoundationPodTest.dst - D SHARED_PRECOMPS_DIR\ =/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/PrecompiledHeaders -D CACHE_ROOT\=/var/folders/h_/83ncwdr50rl1jgn9j4c2v6tw0000gn/C/com.apple.DeveloperTools /15.0-15A240d /Xcode -D CONFIGURATION_BUILD_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator -D CONFIGURATION_TEMP_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData /FoundationPodTest -fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator -D LOCROOT\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodTest -D LOCSYMROOT\=/Users/liyazhu/Desktop/Demo/FoundationPodTest/FoundationPodT est -D INDEX_PRECOMPS_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Index.noindex/PrecompiledHeaders -D INDEX_DATA_STORE_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodT est-fzqialiskgziqaajuzeodfplvyrd/Index .noindex/DataStore -D TEMP_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build -D TARGET_TEMP_DIR\=/Users /liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build -D DERIVED_FILE_DIR\=/Users/liyazhu/Library/Developer/Xcode/DerivedData/ FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/FoundationPodTest.build/Debug-iphonesimulator/FoundationPodTest.build/DerivedSources -f /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermedia tes.noindex/FoundationPodTest. build/Debug-iphonesimulator/FoundationPodTest.build/1aa632d4bc95fc2dc3896fbd09591f33.sb /bin/sh -c /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Intermediates.noindex/Found ationPodTest.build/Debug-iphonesimulator/ FoundationPodTest.build/Script-E88C34EA17BFA0AB5702C3F2.sh

error: Sandbox: rsync(83514) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB. framework/_CodeSignature (in target 'FoundationPodTest' from project 'FoundationPodTest')
error: Sandbox: rsync(83515) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB. framework/.FMDB.3jsiTY (in target 'FoundationPodTest' from project 'FoundationPodTest')
error: Sandbox: rsync(83515) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB. framework/.Info.plist.BO4zG1 (in target 'FoundationPodTest' from project 'FoundationPodTest')
mkdir -p /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks
rsync --delete -av --filter P .*. --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" -- filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/ Debug-iphonesimulator/FMDB/FMDB.framework" "/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks"
building file list ... done
FMDB.framework/FMDB
FMDB.framework/Info.plist
FMDB.framework/_CodeSignature/
rsync: recv_generator: mkdir "/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/_CodeSignature" failed: Operation not permitted (1 )
*** Skipping everything below this failed directory ***
rsync: mkstemp "/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/.FMDB.3jsiTY" failed: Operation not permitted ( 1)
rsync: mkstemp "/Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/.Info.plist.BO4zG1" failed: Operation not permitted (1)

sent 354012 bytes received 70 bytes 708164.00 bytes/sec
total size is 357340 speedup is 1.01
rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/d9889869-120b-11ee-b796-7a03568b17ac/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c (996) [sender=2.6.9]

Sandbox: rsync(83514) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/ _CodeSignature

Sandbox: rsync(83515) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/ .FMDB.3jsiTY

Sandbox: rsync(83515) deny(1) file-write-create /Users/liyazhu/Library/Developer/Xcode/DerivedData/FoundationPodTest-fzqialiskgziqaajuzeodfplvyrd/Build/Products/Debug-iphonesimulator/FoundationPodTest.app/Frameworks/FMDB.framework/ .Info.plist.BO4zG1


Error image

Solution:

Search for user in settings and change User Script Sanboxing to NO

The new version of Xcode 15 compiles and reports this error. On the right toolbar, select 15.0 for both the project’s workspace and the pod’s space.

Reference document: https://www.jianshu.com/p/b28af79dc06c