Add ios error

I used the command that was ionic platform add iOS but error.
The below is the error message. It’s so confused for me ,hope your help.
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1162:11)
at Object.exports.spawn (child_process.js:995:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

I’m receiving the same error, any solutions?

Same here… hope someone can help!

This worked for me :smile:

1 Like

You are right.
At first I entered in my directory. type the command that is sudu chmod -R 777 *.
Then I tried sudo ionic platform update ios.
The message is success.

1 Like

i solved with this solution:

ionic start ABC tabs
cd ABC
ionic hooks <- SOLUTION
ionic platform add [ios|android]

Works on: Ionic CLI Version: 1.3.19

THANK YOU it worked also for me :smile:

I think the correct line is

$ionic hooks add

not just $ionic hooks

Note: I had to remove the current platforms inorder for the platform to be built correctly with the hooks in place.

$ionic platform remove ios
$ionic hooks add 
$ionic platform ios

Then I could build without any errors.

1 Like

Yes, my mistake on write

Correct is: ionic hooks add

Thank you for the solution.

But this’s very weird. We don’t need to execute “ionic hooks add” before.

It would be nice if this is going to be the standard workflow or it is just a workaround for this version.

Thank you for the solution.
Followed what @leogz and @sakotturi said.

  1. removed current iOS platform > added hooks > re-added iOS platform

    $ionic platform remove iOS
    $ionic hooks add
    $ionic platform add iOS

works for me!


Helped me too, thanksssssssss!

one more question,what’s the meaning of hooks?I haven’t developed IOS app before. Can you tell me the essence of this problem ?

Hey, sorry for the late reply man! Been caught up with projects. Well, I’m no master, but from my understanding, hooks is a program used to install other minor missing dependencies or plugins that is stopping your install request. Hooks can also be written to bypass certain minor errors that aren’t worthy to stop your installation.

Warning: I could stand to be corrected. I’m still new too. Just sharing my knowledge and understanding thus far.

Perfect, Thanks bro, your solution actually work.

@hbzb168 Perfect, Thanks bro, your solution actually work.

yep, like everyone said, u just have to add permission t your folder and subfolders, and then sudo ionic build ios, and if you cant run by ionic run ios, so open the platform folder and open de xcode file and run it from xcode.