Getting Started Guide - ionic run ios not working

Hi,

I am newbie on Ionic, and I am follow Getting Started Guide on this page: [Ionic Framework - The Cross-Platform App Development Leader][1]
When I run the follow command:

duly-imac:aaclient eldontc$ ionic run ios    

The result is:

Running run task…
Running app on platform ios
Generating config.xml from defaults for platform “ios”
Preparing ios project
Running app on platform “ios” via command “/dados-usr/trabalho/aaclient/aaclient/platforms/ios/cordova/run”
Error: An error occurred while running the ios project.Error: ios-deploy was not found. Please download, build and install version 1.0.4 or greater from GitHub - ios-control/ios-deploy: Install and debug iPhone apps from the command line, without using Xcode into your path. Or ‘npm install -g ios-deploy’ using node.js: http://nodejs.org/

at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/run.js:66:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

Unable to run app on platform ios. Please see console for more info.

Ok. The I run the command:

duly-imac:aaclient eldontc$ sudo npm install -f ios-deploy
Password:
npm WARN using --force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/ios-deploy
npm http 200 https://registry.npmjs.org/ios-deploy
npm http GET https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.4.tgz
npm http 200 https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.4.tgz

ios-deploy@1.0.4 preinstall /dados-usr/trabalho/aaclient/aaclient/node_modules/ios-deploy
make ios-deploy

rm -rf *.app demo ios-deploy
gcc -o ios-deploy -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
ios-deploy@1.0.4 node_modules/ios-deploy

And I did try do run the command again:

duly-imac:aaclient eldontc$ ionic run ios
Running run task…
Running app on platform ios
Generating config.xml from defaults for platform “ios”
Preparing ios project
Running app on platform “ios” via command “/dados-usr/trabalho/aaclient/aaclient/platforms/ios/cordova/run”
Error: An error occurred while running the ios project.Error: ios-deploy was not found. Please download, build and install version 1.0.4 or greater from GitHub - ios-control/ios-deploy: Install and debug iPhone apps from the command line, without using Xcode into your path. Or ‘npm install -g ios-deploy’ using node.js: http://nodejs.org/

at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/run.js:66:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

Unable to run app on platform ios. Please see console for more info.

I appreciate some help.

Cheers

Just at first glance looks like you ran sudo npm install -f ios-deploy not sudo npm install -g ios-deploy

Tthe -g flag is for global :slight_smile: which is why it doesn’t know that ios-deploy is installed.

@tim Thanks for your response Tim.

I did run the command that you indicate but not works for me. See:

duly-imac:aaclient eldontc$ sudo npm install -f ios-deploy
Password:
npm WARN using --force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/ios-deploy
npm http 200 https://registry.npmjs.org/ios-deploy
npm http GET https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.4.tgz
npm http 200 https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.4.tgz

ios-deploy@1.0.4 preinstall /dados-usr/trabalho/aaclient/aaclient/node_modules/ios-deploy
make ios-deploy

rm -rf *.app demo ios-deploy
gcc -o ios-deploy -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
ios-deploy@1.0.4 node_modules/ios-deploy

duly-imac:aaclient eldontc$ ionic run ios
Running run task...
Running app on platform ios
Generating config.xml from defaults for platform "ios"
Preparing ios project
Running app on platform "ios" via command "/dados-usr/trabalho/aaclient/aaclient/platforms/ios/cordova/run" 
Error: An error occurred while running the ios project.Error: ios-deploy was not found. Please download, build and install version 1.0.4 or greater from https://github.com/phonegap/ios-deploy into your path. Or 'npm install -g ios-deploy' using node.js: http://nodejs.org/

    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/run.js:66:22)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)
Unable to run app on platform ios. Please see console for more info.

You ran sudo npm install -f ios-deploy again…

You need to run sudo npm install -g ios-deploy, notice the -g NOT -f.

Ok, my mistake man, I don’t believe that, sorry.

It works now!

I have just installed note.js on windows 8
with npm installed git, ant, corova & ionic

is the WARN an issue?

C:\Users\amercer\AppData\Roaming\npm\ionic -> C:\Users\amercer\AppData\Roaming\npm\node_modules\ionic\bin\ionic
ionic@0.9.13 C:\Users\amercer\AppData\Roaming\npm\node_modules\ionic
├── ncp@0.4.2
├── shelljs@0.2.6
├── optimist@0.6.0 (wordwrap@0.0.2, minimist@0.0.5)
├── event-stream@3.0.20 (stream-combiner@0.0.4, duplexer@0.1.1, from@0.1.3, pause-stream@0.0.11, map-stream@0.0.4, split@0.2.10, through@2.3.4)
├── unzip@0.1.9 (setimmediate@1.0.1, match-stream@0.0.2, readable-stream@1.0.25, pullstream@0.4.0, fstream@0.1.25, binary@0.3.0)
├── request@2.27.0 (forever-agent@0.5.2, aws-sign@0.3.0, json-stringify-safe@5.0.0, qs@0.6.6, tunnel-agent@0.3.0, oauth-sign@0.3.0,cookie-jar@0.3.0, mime@1.2.11, node-uuid@1.4.1, hawk@1.0.0, http-signature@0.10.0, form-data@0.1.2)
└── cordova@3.2.0-rc.1 (ncallbacks@1.0.0, colors@0.6.2, semver@1.1.0, open@0.0.3, mime@1.2.11, q@0.9.7, follow-redirects@0.0.3, shelljs@0.1.2, elementtree@0.1.5, glob@3.2.8, xcode@0.6.2, tar@0.1.19, prompt@0.2.7, request@2.22.0, express@3.0.0, plist@0.4.3, ripple-emulator@0.9.18, npm@1.3.26, plugman@0.15.0)

I then get this

C:\websites\ionic>ionic start myApp
Running start task…
Creating Ionic app in folder C:\websites\ionic\myApp
Downloading starter template from https://github.com/driftyco/ionic-angular-cordova-seed/archive/master.zip
Project created!
Initializing cordova project.
Fetching plugin “org.apache.cordova.device” via plugin registry
Error: Fetching plugin failed: Error: Failed to fetch package information for org.apache.cordova.device
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:105:41
at _rejected (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Fetching plugin “org.apache.cordova.console” via plugin registry
Error: Fetching plugin failed: Error: Failed to fetch package information for org.apache.cordova.console
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:105:41
at _rejected (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Fetching plugin “org.apache.cordova.statusbar” via plugin registry
Error: Fetching plugin failed: Error: Failed to fetch package information for org.apache.cordova.statusbar
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:105:41
at _rejected (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\amercer\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)

i’ve got the same issue that @eldontc has, but also after running sudo npm install -g ios-deploy i get the same error. Any idea why?


Here’s what i run (emulate) and the result:

myUser appName$ ionic emulate ios

Running emulate task…
Emulating app on platform ios
Generating config.xml from defaults for platform “ios”
Preparing ios project
Running on emulator for platform “ios” via command “/Applications/MAMP/htdocs/testIonic/platforms/ios/cordova/run” --emulator
Error: An error occurred while emulating/deploying the ios project. ** BUILD FAILED **

The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **

The following build commands failed:
CompileC build/StarterApp.build/Debug-iphonesimulator/StarterApp.build/Objects-normal/i386/CDVStatusBar.o StarterApp/Plugins/org.apache.cordova.statusbar/CDVStatusBar.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/emulate.js:67:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

Unable to emulate app on platform ios. Please see console for more info.

NOTE: i have successfully installed ios-sim with npm install -g ios-sim (although it had been previously installed via homebrew so i had to run brew uninstall ios-sim before reinstalling it)

try to run

cordova plugin add org.apache.cordova.statusbar

manually. And then build and emulate the project.

@Ciraxis thanks for your reply.

Plugin “org.apache.cordova.statusbar” already installed, 'sall good.

…but if i run ionic build ios or ionic emulate io : same result (error mentioned above).

Have you removed the plugin and add it again?

Or maybe open the emulator and then run ionic emulate.

@Ciraxis thanks for your reply.
Yes and yes…same result.

Have you used the latest ionic cli?

On Android emulator it works?

maybe that issue could help you

@Ciraxis thanks for your interest in my issue.

To answer your questions:
Yes, i’m using the latest ionic cli.
Yes, Android works fine.

I’ve read the issue you posted and tried running cordova platform update ios

Result:

ios updated to 3.3.0