# Add ios error

**URL:** <https://forum.ionicframework.com/t/add-ios-error/20262>\
**Category:** ionic-v1\
**Created:** [April 4, 2015, 12:40am UTC](https://forum.ionicframework.com/t/add-ios-error/20262 "2015-04-04T00:40:04Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbzb168](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hbzb168](https://forum.ionicframework.com/u/hbzb168)\
**Post date:** [April 4, 2015, 12:40am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/1 "2015-04-04T00:40:04Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![xjabu](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/xjabu/32/81199_2.png) [@xjabu](https://forum.ionicframework.com/u/xjabu)\
**Post date:** [April 4, 2015, 5:51am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/2 "2015-04-04T05:51:04Z")

</div>

I’m receiving the same error, any solutions?

---

<div class="post-metadata">

**Author:** ![gergar](https://avatars.discourse-cdn.com/v4/letter/g/e274bd/32.png) [@gergar](https://forum.ionicframework.com/u/gergar)\
**Post date:** [April 4, 2015, 6:14am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/3 "2015-04-04T06:14:24Z")

</div>

Same here… hope someone can help!

---

<div class="post-metadata">

**Author:** ![xjabu](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/xjabu/32/81199_2.png) [@xjabu](https://forum.ionicframework.com/u/xjabu)\
**Post date:** [April 4, 2015, 6:22am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/4 "2015-04-04T06:22:11Z")

</div>

This worked for me 😄

> [@Crosswalk Error with Ionic CLI 1.3.8](http://forum.ionicframework.com/t/crosswalk-error-with-ionic-cli-1-3-8/17054/8):
>
> I ended up changing the permissions on my directory and all subdirectories after the first failed attempt. Then, I run all my commands as sudo and things seems to work. sudo find /Users/matt/Documents/\_Ionic/myApp -type d -exec chmod -R 777 {} \;

---

<div class="post-metadata">

**Author:** ![hbzb168](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hbzb168](https://forum.ionicframework.com/u/hbzb168)\
**Post date:** [April 4, 2015, 12:10pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/5 "2015-04-04T12:10:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![leogz](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@leogz](https://forum.ionicframework.com/u/leogz)\
**Post date:** [April 4, 2015, 12:49pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/6 "2015-04-04T12:49:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gergar](https://avatars.discourse-cdn.com/v4/letter/g/e274bd/32.png) [@gergar](https://forum.ionicframework.com/u/gergar)\
**Post date:** [April 4, 2015, 9:07pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/7 "2015-04-04T21:07:08Z")

</div>

THANK YOU it worked also for me 😄

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [April 6, 2015, 4:51pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/8 "2015-04-06T16:51:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![leogz](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@leogz](https://forum.ionicframework.com/u/leogz)\
**Post date:** [April 6, 2015, 5:28pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/9 "2015-04-06T17:28:43Z")

</div>

Yes, my mistake on write

Correct is: ionic hooks add

---

<div class="post-metadata">

**Author:** ![teerasej](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/teerasej/32/71010_2.png) [@teerasej](https://forum.ionicframework.com/u/teerasej)\
**Post date:** [April 7, 2015, 5:40am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/10 "2015-04-07T05:40:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bradax](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Bradax](https://forum.ionicframework.com/u/Bradax)\
**Post date:** [April 10, 2015, 2:55am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/11 "2015-04-10T02:55:36Z")

</div>

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

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

works for me!

---

<div class="post-metadata">

**Author:** ![ArdentKid](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ardentkid/32/84496_2.png) [@ArdentKid](https://forum.ionicframework.com/u/ArdentKid)\
**Post date:** [April 14, 2015, 5:01am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/12 "2015-04-14T05:01:08Z")

</div>

Helped me too, thanksssssssss!

---

<div class="post-metadata">

**Author:** ![lzlun129](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@lzlun129](https://forum.ionicframework.com/u/lzlun129)\
**Post date:** [April 29, 2015, 3:23am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/13 "2015-04-29T03:23:40Z")

</div>

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 ？

---

<div class="post-metadata">

**Author:** ![Bradax](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Bradax](https://forum.ionicframework.com/u/Bradax)\
**Post date:** [June 11, 2015, 6:43am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/14 "2015-06-11T06:43:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Umaid](https://avatars.discourse-cdn.com/v4/letter/u/58956e/32.png) [@Umaid](https://forum.ionicframework.com/u/Umaid)\
**Post date:** [October 18, 2015, 5:03am UTC](https://forum.ionicframework.com/t/add-ios-error/20262/15 "2015-10-18T05:03:42Z")

</div>

Perfect, Thanks bro, your solution actually work.

---

<div class="post-metadata">

**Author:** ![Umaid](https://avatars.discourse-cdn.com/v4/letter/u/58956e/32.png) [@Umaid](https://forum.ionicframework.com/u/Umaid)\
**Post date:** [October 19, 2015, 2:20pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/16 "2015-10-19T14:20:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![miguel\_trevino](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/miguel_trevino/32/92499_2.png) [@miguel\_trevino](https://forum.ionicframework.com/u/miguel_trevino)\
**Post date:** [October 20, 2015, 7:08pm UTC](https://forum.ionicframework.com/t/add-ios-error/20262/17 "2015-10-20T19:08:20Z")

</div>

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.
