Ionic cordova run cannot specifiy target


#1

Hi all,

I’ve managed to get ‘ionic cordova run’ to work but only without any options, it then opens up the simulator on an iphone X.

I’m trying to get it to use iphone 6 with ios 10.0.

Command:
ionic cordova run ios --target="iPhone-6, 10.0"

Output:

Device id for device name "iPhone 6" and runtime "iOS 10.0" could not be found, or is not available.
[ERROR] An error occurred while running cordova run ios --target "iPhone-6, 10.0" (exit code 1).

I’ve renamed the simulator in xcode > manage devices, to “iPhone-6, 10.0” but this doesn’t seem to solve things.

More info:

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0
cordova (Cordova CLI) : 7.1.0
@ionic/app-scripts : 3.1.5
Cordova Platforms  : ios 4.5.0
Ionic Framework    : ionic-angular 3.9.2
ios-deploy : 1.9.2
ios-sim    : 6.1.2
Node       : v6.9.1
npm        : 5.0.3
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

Thanks!


#2

What does ionic cordova run ios --list return?
ionic cordova emulate ios --list


#3

First one I get empty list.

Second, I get

Available ios virtual devices:
iPhone-5, 10.0
iPhone-5s, 10.0
iPhone-5s, 11.2
iPhone-6, 11.2
iPhone-6-Plus, 10.0
iPhone-6-Plus, 11.2
iPhone-6s, 10.0
iPhone-6s, 11.2
iPhone-6s-Plus, 10.0
iPhone-6s-Plus, 11.2
iPhone-7, 11.2
iPhone-7-Plus, 11.2
iPhone-SE, 10.0
iPhone-SE, 11.2
iPad-Air, 10.0
iPad-Air, 11.2
iPad-Air-2, 10.0
iPad-Air-2, 11.2
iPad--5th-generation-, 11.2
iPad-Pro--9-7-inch-, 10.0
iPad-Pro, 10.0
iPad-Pro--12-9-inch---2nd-generation-, 11.2
iPad-Pro--10-5-inch-, 11.2
iPad-Retina, 10.0
Apple-TV-1080p, tvOS 11.2
Apple-TV-4K-4K, tvOS 11.2
Apple-TV-4K-1080p, tvOS 11.2
iPhone-8, 11.2
iPhone-8-Plus, 11.2
iPhone-X, 11.2
iPad-Pro--9-7-inch-, 11.2
iPad-Pro, 11.2
Apple-Watch-38mm, watchOS 4.2
Apple-Watch-42mm, watchOS 4.2
Apple-Watch-Series-2-38mm, watchOS 4.2
Apple-Watch-Series-2-42mm, watchOS 4.2
Apple-Watch-Series-3-38mm, watchOS 4.2
Apple-Watch-Series-3-42mm, watchOS 4.2

Which doesn’t contain my device! So I need to add it to that list then. .


#4

run probably only contains real devices.

Renaming it may have messed with the list.

Can you use all the others?


#5

Yep you’re right, I renamed the device back to default and it appeared in the list. Others also work fine.

Funny I only renamed to help fix it, as it also wasn’t working before. Not sure what really was the cause then.

Thanks a lot.