iOS 'No target specified for emulator' after Cordova 4.3.0 Update

Hello,

After updating from Cordova 4.2.0 to Cordova 4.3.0 I’ve found that the command:

ionic run ios

…always deploys to the emulator. (cordova run ios does the same thing)

I can deploy to the test iPhone from Xcode no problem. The message is:

** BUILD SUCCEEDED **

No target specified for emulator. Deploying to iPhone-6 simulator

If I revert to Cordova 4.2.0 then it works fine. According to http://cordova.apache.org/ there’s been some changes to ios-deploy so I was careful to update to ios-deploy 1.4.0.

Could do with some insight as its a pain to have to use Xcode in this way.

Thanks,

Ben.

Easy solution thanks to the wisdom of others at https://groups.google.com/forum/#!topic/phonegap/QtVXVKuZKsY

With 4.3.0 looks like you have to explicitly force it to go to the device:

ionic run ios --device

Not sure what changed in 4.3.0 to make that required rather than just have the cli figure it out.

2 Likes

that fix is not working for me…

ended up updating/re-installing ios-deploy

sudo npm install -g ios-deploy

This was driving me crazy for a few hours the other night. The solution for me was to update/re-install ios-deploy & explicitly force it to target the device. Thanks guys!

sudo npm install -g ios-deploy

and

ionic run ios --device

Hi guys,

I need your help. I am running ionic on OSX Yosemite 10.10.2 and after I installed ios-deploy and tried to run ionic run ios --device I got this error:

** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Chris/Documents/Projects/WOTMI/platforms/ios/cordova/build-debug.xcconfig,-project,wotemai.xcodeproj,ARCHS=armv7 armv7s arm64,-target,wotemai,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/Chris/Documents/Projects/WOTMI/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/Chris/Documents/Projects/WOTMI/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/Chris/Documents/Projects/WOTMI/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project

Does anyone had such an error and managed to debug it?

Thanks!

Christina

did you try this?

Yes, same error message.

hmm… how about re-installing ios-sim?

I have basically reinstalled it all and still same error message.

I also have problem running ionic on the simulator. I have no such problems with the Android one. Completely out of ideas? The device I try to run the app to is an iPhone 6 -> A1549. Even tried the Windows solution: restarting the system :). Xcode version: 6.1.1. I am also trying to deploy on a non original cable, but as the emulator gives me the same error, I think it is not hardware related.

Did you do something to your device before you started deploying? Anything like enable them for dev or something? I am a frontend dev, so I haven’t looked that deep into the iphone’s specifics.

Thanks in advance!
Chris

I would try and open xcode and build a simple app… just pick a template and build it to see if you can deploy that to simulator or device.

Hi aaronksaunders,

Thanks you for all your help! I managed to get the emaultaor running via yakupme post in here: https://github.com/driftyco/ionic-cli/issues/317

I am quoting him/her:

Create a file with name emulate.sh in your app directory. Copy the following code in your emulate.sh file.

#!/bin/bash
# Manually emulate ionic/cordova application
# Miroslav Masat 2014 

echo "Emulating..."
cd ./platforms/ios/build/emulator
var=$(pwd)

ios-sim launch "$var"/*.app

While running your project instead of running the the following command

that did the trick for me, didn’t know the --device options was added

1 Like

I fixed by removing the platforms folder and then:

ionic platform add ios