Add ios error

#1

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.
Thanks.
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)

#2

I’m receiving the same error, any solutions?

#3

Same here… hope someone can help!

#4

This worked for me :smile:

1 Like
#5

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
#6

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

#7

THANK YOU it worked also for me :smile:

#8

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.

2 Likes
#9

Yes, my mistake on write

Correct is: ionic hooks add

#10

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.

#11

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!

2 Likes
#12

Helped me too, thanksssssssss!

#13

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 ?

#14

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.

#15

Perfect, Thanks bro, your solution actually work.

#16

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

#17

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.