Feihua Fang
Feihua Fang

Reputation: 1121

when I built my app in xcode,there is an error:/bin/sh: bad interpreter: Operation not permitted

the error information:

/Users/baymac/Library/Developer/Xcode/DerivedData/Accelerometer_Nodes-ccicmwcpsbuvnnfllupzhsbpxwrr/Build/Intermediates/Accelerometer Nodes.build/Debug-iphoneos/Accelerometer Nodes.build/Script-2C82A787FAD9698819CAEFB4.sh: /Users/baymac/Documents/patrick lab/ios project/DeviceToPhone/Pods/Target Support Files/Pods/Pods-frameworks.sh: /bin/sh: bad interpreter: Operation not permitted Command /bin/sh failed with exit code 126

I have tried pods install or chmod,they are useless,it would be so nice if any one can help me!!

Upvotes: 12

Views: 14358

Answers (5)

Diego E. Maidana
Diego E. Maidana

Reputation: 21

Regarding the answer of mcarriere

For me what fixed it was removing

ENABLE_USER_SCRIPT_SANDBOXING = YES; from project.pbxproj. It was added as a suggested setting by XCode. It seems to >be incompatible with Capacitor which i'm using to build my app.

I just changed the ENABLE_USER_SCRIPT_SANDBOXING = NO and it worked.

Upvotes: 0

mcarriere
mcarriere

Reputation: 389

For me what fixed it was removing

ENABLE_USER_SCRIPT_SANDBOXING = YES;

from project.pbxproj. It was added as a suggested setting by XCode. It seems to be incompatible with Capacitor which i'm using to build my app.

Upvotes: 10

Rahul Patel
Rahul Patel

Reputation: 209

Try to remove .xcworkspace and Podfile.lock files also remove folder Pod

then open terminal type cd put path of your project root folder press enter type pod install or pod update press enter

Upvotes: 13

NMaks
NMaks

Reputation: 249

I faced same issue.

Reason: If you download project from internet, executable .sh files will be quarantined, and system doesn't allow them to execute.

Cure: You should remove extended attributes to make these executables work.

In terminal

xattr -rc directory_where_executables_located

this will recursively remove extended attributes from files in directory_where_executables_located

Upvotes: 22

Feihua Fang
Feihua Fang

Reputation: 1121

if install pods is useless,maybe you can find the path of the file with error,for example,my path is /Users/baymac/Documents/patrick lab/ios project/DeviceToPhone/Pods/Target Support Files/Pods/Pods-frameworks.sh

then you can use this instruct: xattr -d com.apple.quarantine+ your path,for example:

xattr -d com.apple.quarantine /Users/baymac/Documents/patrick lab/ios project/DeviceToPhone/Pods/Target Support Files/Pods/Pods-frameworks.sh

make sure your path is right.

and my problem is fixed!

Upvotes: 18

Related Questions