Xcode 10构建失败rm权限在/ bin / sh /中被拒绝

时间:2018-11-02 08:09:09

标签: xcodebuild xcode10 macos-mojave

我最近将系统更新为
Xcode:10
OSX:Mojave 10.14

几天来,我的iOS开发工作正常,但突然开始遇到以下问题。

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

但是此问题已通过更改Xcode-> File-> Workspace Setting-> Build Setting-> Legacy Build Setting

得到解决

然后我在构建目标时使用的一种外壳脚本中的rm命令遇到权限拒绝错误。

xcode build error

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

暂时,我需要使用sudo xcodebuild构建目标。找不到任何使用xcode触发构建的方法来避免此错误。

1 个答案:

答案 0 :(得分:1)

这里有两个不同的问题:

  1. 为什么shell脚本抛出错误?

这是由于MacOS Mojave隐私保护。 您需要授予XCode权限以具有“全盘访问”权限。您可以在“系统偏好设置”->“安全性和隐私权enter image description here

中执行此操作
  1. XCode 10使用new build system
  

Xcode 10使用新的构建系统。新的构建系统提供   改进的可靠性和构建性能,并抓住项目   旧版构建系统没有的配置问题。

我不确定为什么几天后会发生错误,但也许与ALWAYS_SEARCH_USER_PATHS中的更改有关。我对此不确定,但是您可以尝试在Target-> General-> Embedded Binaries

中将Appsee.framework添加为嵌入式二进制文件。