Ionic2 - ionic build ios fails but emulate works?

I am testing my app with emulate ios becausebuild ios fails with

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

Running emulate , stopping the emulator, open XCode and deploy works fine.

Hence - why? I just want to get it to build, I do not need it to automatically deploy it to my device? I am worried that I will not be able to run production but will have to use the dev build to push to app store…

Is there a reason you don’t want to install ios-deploy? It’s required to automate the iOS build process. I’m not sure what that has to do with pushing dev / production builds to the app store, maybe you can explain your concern a little more?

The app store is really pissy anyway, you’re going to either need to use Xcode or the Application Loader to submit your “production” application anyway.

[quote=“bsampica, post:2, topic:73803, full:true”]
Is there a reason you don’t want to install ios-deploy? It’s required to automate the iOS build process. I’m not sure what that has to do with pushing dev / production builds to the app store, maybe you can explain your concern a little more?

Here’s why:

sudo npm install -g ios-deploy

npm WARN lifecycle ios-deploy@1.9.0~preinstall: cannot run in wd %s %s (wd=%s) ios-deploy@1.9.0 ./src/scripts/check_reqs.js && xcodebuild /usr/local/lib/node_modules/.staging/ios-deploy-298c9491
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy'
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/me/Documents/Projects/Typescript/App/npm-debug.log
[/quote]


The app store is really pissy anyway, you're going to either need to use Xcode or the Application Loader to submit your "production" application anyway.

Sure, I am familiar with the iOS publication process…

this solved the issue
sudo npm install -g ios-deploy -unsafe-perm

3 Likes

The same with me. Not sure why this happens but yes installing ios-deploy globally solved my issue.