Reputation: 471
I'm working on a IOS Game that I built using Unity and I'm trying to get it to build on Xcode. However I keep getting this Shell Script Invocation Error "/Users/masterolu/Downloads/ShoeJackCityBuilds/iOS/MapFileParser.sh: Permission denied".
I've tried to use chmod +x /Users/masterolu/Downloads/ShoeJackCityBuilds/iOS/MapFileParser.sh but for some reason my machine doesn't recognize the chomd command anymore. I tried to reinstall it by using sudo apt install --reinstall coreutils but in order to use apt I need a JDK(Java Developer Kit). So I install the latest JDK and when I try to reinstall chomd my terminal says "Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/bin/apt" (-1)". At this point I decided it's best to come and ask for help.
Any ideas on how to fix this error in Xcode or how to install chomd so my app can run?
Upvotes: 5
Views: 9292
Reputation: 1
You need to "chmod +x" the file in question to add execute permissions.
"chmod -x" REMOVES execute permissions which is exactly opposite of what you want.
"chmod 755" is equivalent of "chmod +x" but you have to specifically know what the octal value means whereas +/- x is much more clear.
You definitely don't want to do "chmod 777" as that just adds ALL read-write-execute permissions for ALL users. Bad for security, and not the targeted-focus change wanted.
Upvotes: 0
Reputation: 91
So, apparently Apple likes to disable the execution permission of all the shell scripts that have not been created on your machine (i.e. downloaded from web, cloned from repo) so what you have to do is to open a terminal inside the project folder and run chmod -x MapFileParser.sh
, that should fix it.
I have also done it on the process_symbols.sh
just to be sure it runs.
My solution for my gihub action was this as the -x version did not work correctly for my scenario.
- name: Update scripts permissions
run: |
pwd
sudo chmod 755 MapFileParser.sh
sudo chmod 755 process_symbols.sh
Upvotes: 6