解决mac os上网上下下来的可执行文件无法执行的错误

找到解决办法 : http://blog.omgmog.net/post/a-possible-solution-to-bad-interpreter-operation-not-permitted-error-on-mac-os-x-lion/

原文如下:

Out of the blue I started having an issue in my Terminal.app on Lion where downloaded scripts/applications wouldn’t run. I first noticed this when trying to setup the Android SDK.

The problem looks like this:

-bash: ./android: /bin/sh: bad interpreter: Operation not permitted

After a bit of Google-fu, and a bunch of Apple Support Community threads that ended in people arguing about whether or not TextEdit caused this issue, I found a cause and a solution.

It turns out that for some reason, on Mac OS X Lion 10.7.3 apple is storing acom.apple.quarantine metadata file, which prevents executable files from being executed. Why is it doing this? Probably because the executable file was downloaded from the internet? who knows?

Anyway, there is a solution:

xattr -rd com.apple.quarantine [directory containing the executables]

So, for me with the Android SDK, I ran the following:

xattr -rd com.apple.quarantine /android-sdk/

This command deletes the com.apple.quarantine metadata files, allowing you to execute the executables.

That's a lengthy title I know, but it's there for the sake of keywords/SEO and such.

 

 

 

转载于:https://www.cnblogs.com/cszjutstar/archive/2013/03/26/2983147.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值