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 ?
sed
oniOs
expects a backup file suffix after-i
option. Even when you think you haven't provided it, it will take next argument as suffix.So, it takes
/use_frameworks/a HelloPod1
as suffix and../Podfile
as sed command.../Podfile
is not a valid sed command, which causes the error.This should work:
Now, it takes
.bak
as backup suffix,/use_frameworks/a HelloPod1
as sed command and../Podfile
as the file to operate on.