We are trying to update the file using run scripts. We are using the command
sed -i '/use_frameworks/a HelloPod1' ../Podfile
and building the application then we are getting error link this
sed: 1: "../Podfile": invalid command code . Command /bin/sh failed with exit code 1
If we try to run the command from terminal its working fine.
sed command won't work in Xcode run scripts ? How can we insert the new lines in file ?
sedoniOsexpects a backup file suffix after-ioption. Even when you think you haven't provided it, it will take next argument as suffix.So, it takes
/use_frameworks/a HelloPod1as suffix and../Podfileas sed command.../Podfileis not a valid sed command, which causes the error.This should work:
Now, it takes
.bakas backup suffix,/use_frameworks/a HelloPod1as sed command and../Podfileas the file to operate on.