Xcode 10 build fail rm permission denied in /bin/sh/

霸气de小男生 提交于 2019-12-13 03:47:45

问题


I recently update my system to
Xcode: 10
OSX : Mojave 10.14

For few days my iOS development works fine, but suddenly start facing following issues.

dyld: Library not loaded: @rpath/Appsee.framework/Appsee
 Referenced from: /Users/a.b.ak1b/Library/Developer/CoreSimulator/Devices/2223E5BD-215F-48D7-8649-2D63ECBAE2B6/data/Containers/Bundle/Application/59E09AD0-ADAB-4221-A334-70F71DC6AC0B/MyApp.app/MyApp
 Reason: image not found

But this issue was fixed by changing Xcode->File->Workspace Setting->Build Setting->Legacy Build Setting

Then I getting permission denied error for rm command in one of shell script used while building the target.

Showing All Messages
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Common: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/USGlobals.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRKeepAliveData.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/AFSOAPClient.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubRegistrationData.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubProxy.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/CMSeatMapWingView.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubProxyInterface.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRLog.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/GrafanaClient.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/NSObject+SRJSON.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubConnectionInterface.h: Permission denied
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubInvocation.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/AFIncrementalStoreHTTPClient.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRHubConnection.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRLongPollingTransport.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/ApplicationBuildConfiguration.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/ServiceConfiguration.h: Permission denied        
rm: /Users/a.b.ak1b/Documents/work/iOS-App-1/Library/Common/../Vendor/Common.framework/Versions/A/Headers/SRConnectionInterface.h: Permission denied

For the time-being I need to build the target using sudo xcodebuild. Not found any way to trigger build using xcode to avoid this error.


回答1:


There are two different issues here:

  1. Why shell script is throwing error?

This is because of MacOS Mojave privacy protection. You need to give permission to XCode to have Full Disk Access. You can do this in System Preferences->Security&Privacy

  1. XCode 10 uses a new build system.

Xcode 10 uses a new build system. The new build system provides improved reliability and build performance, and it catches project configuration problems that the legacy build system does not.

I am not sure why the error happened after few days but perhaps it has to do with changes in ALWAYS_SEARCH_USER_PATHS. I am not sure about this, but you can try adding Appsee.framework as an embedded binary in Target-> General-> Embedded Binaries



来源:https://stackoverflow.com/questions/53114815/xcode-10-build-fail-rm-permission-denied-in-bin-sh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!