cordova-ios
cordova-ios copied to clipboard
Unable to find a destination matching the provided destination specifier
Bug Report
I'm having an error when I execute cordova build
.
error: Unable to find a destination matching the provided destination specifier: { platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
Since my app only builds on iPad, I think I need to set a build target to an iPad, but I'm not sure how to do this.
My config.xml has these tags to specify iPad only:
<preference name="target-device" value="tablet" />
<preference name="deployment-target" value="10.3" />
The full error reads:
Reading build config file:
No simulator found for ". Falling back to the default target.
Building for "iPhone 11 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max, iPhone-11-Pro-Max).
Building project: /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/Sokketsu.xcworkspace
Configuration: Debug
Platform: emulator
Target: iPhone 11 Pro Max
Running command: xcodebuild -workspace Sokketsu.xcworkspace -scheme Sokketsu -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/sharedpch
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator
SDKROOT = iphonesimulator13.1
SHARED_PRECOMPS_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/sharedpch
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
Available destinations for the "Sokketsu" scheme:
{ platform:iOS Simulator, id:B90FC025-F8EB-40B3-90C5-E9094C0FFD17, OS:13.1, name:iPad Air (3rd generation) }
{ platform:iOS Simulator, id:3131A6AD-3C4E-4CEA-8889-9C7E22EAF816, OS:13.1, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:A8055BC4-F95C-43FA-8B28-7FACBD3D57B6, OS:13.1, name:iPad Pro (11-inch) }
{ platform:iOS Simulator, id:7FAD7B1C-70DD-407A-AC99-3ACAD2670726, OS:13.1, name:iPad Pro (12.9-inch) (3rd generation) }
Ineligible destinations for the "Sokketsu" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
xcodebuild: Command failed with exit code 70
What is expected to happen?
For it to build. 😄
What does actually happen?
The above error.
Information
I also tried stuff like
cordova platform rm ios
cordova platform add ios@5
But without luck.
Command or Code
cordova build
Environment, Platform, Device
- MacOS: 10.15 Catalina
Version information
- XCode: Version 11.1 (11A1027)
- Cordova: [email protected]
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Same issue here with cordova-ios
version 5.0.1 when running cordova build ios
command. To get it to build, you need to set the target-device
to universal
and then change it back to tablet in Xcode when finished.
config.xml
<preference name="target-device" value="tablet" />
<preference name="deployment-target" value="11.0.0" />
<preference name="Orientation" value="landscape" />
console output:
No simulator found for ". Falling back to the default target.
Building for "iPhone 11 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max, iPhone-11-Pro-Max).
Building project: /Users/eightysix/Desktop/Projects/CochraneApp/platforms/ios/Presentation Dev.xcworkspace
Configuration: Debug
Platform: emulator
Target: iPhone 11 Pro Max
Running command: xcodebuild -workspace Presentation Dev.xcworkspace -scheme Presentation Dev -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/eightysix/Desktop/Projects/CochraneApp/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/eightysix/Desktop/Projects/CochraneApp/platforms/ios/build/sharedpch
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/eightysix/Desktop/Projects/CochraneApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator13.0
SHARED_PRECOMPS_DIR = /Users/eightysix/Desktop/Projects/CochraneApp/platforms/ios/build/sharedpch
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
Available destinations for the "Presentation Dev" scheme:
{ platform:iOS Simulator, id:822F5A42-0B38-40AE-BD08-4E4CE8B791FB, OS:13.0, name:iPad Air (3rd generation) }
{ platform:iOS Simulator, id:817D536B-56A9-48E4-A1B2-4CB7C94D54D4, OS:13.0, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:8759C123-201E-4623-9E5B-0AAE927E51D3, OS:13.0, name:iPad Pro (11-inch) }
{ platform:iOS Simulator, id:4C26DEC9-0236-40A7-A0E0-4CC83670A600, OS:13.0, name:iPad Pro (12.9-inch) (3rd generation) }
Ineligible destinations for the "Presentation Dev" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
xcodebuild: Command failed with exit code 70
Ionic:
Ionic CLI : 5.4.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.1
@angular-devkit/build-angular : 0.803.1
@angular-devkit/schematics : 8.3.1
@angular/cli : 8.3.1
@ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.2, (and 20 other plugins)
Utility:
cordova-res : 0.8.0
native-run : not installed
System:
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v12.8.1 (/usr/local/bin/node)
npm : 6.11.3
OS : macOS Mojave
Xcode : Xcode 11.0 Build version 11A420a
@mesqueeb You need to specify a target for cordova build
command. Try to run cordova build --target iPad-Pro--9-7-inch-
.
We're having the same issue with an Ionic app using cordova. But once the app code is transpiled and the build directory is ready it can be built and run from xcode. Not exactly slick, but at least we can continue working.
@vargtimmen It depends on your ionic version, I assume you are using ionic v3. To get a list of all available emulators you can run ionic cordova emulate ios --list
and to build the app you can run ionic cordova build ios -- --target iPad-Pro--9-7-inch-
, where you need to replace emulator for one of the iPad emulators you have.
@astme
@vargtimmen It depends on your ionic version, I assume you are using ionic v3.
You're right, this seems to happen with ionic 3 but not 4. Thx for the hint.
Open your project in xcode "project_name.xcodeproj" and make sure in the general tab where it say "Deployment Info" both iPhone and iPad selected. I had this issue when I unselected the iPhone!
answer is here: https://stackoverflow.com/questions/58374192/how-to-specify-cordova-build-target-in-build-json
I also posted this in the above mentioned StackOverflow question as an answer
You can solve this issue by sending the device name as a buildFlag
If you are using cordova use below command
cordova build ios --buildFlag="-destination platform=iOS Simulator,name=iPad Pro (11-inch)"
For me, I was using this in an Ionic project.
ionic cordova build ios -- --buildFlag="-destination platform=iOS Simulator,name=iPad Pro (11-inch)"
You can choose any device name you want from the list Available destinations listed in your error
Same issue for me.
To run emulator with livereload, I have to specify both --target
for ionic/cordova and --buildFlag
for xcodebuild
e.g.
$ ionic cordova emulate ios --livereload --target="iPad-Pro--12-9-inch---4th-generation-, 13.6" -- --buildFlag="-destination platform=iOS Simulator,name=iPad Pro (12.9-inch) (4th generation)"
We're having the same issue with an Ionic app using cordova. But once the app code is transpiled and the build directory is ready it can be built and run from xcode. Not exactly slick, but at least we can continue working.
Yes exactly.This did the trick for me.
1) sudo ionic cordova platform rm ios 2) sudo ionic cordova platform add [email protected] 3) sudo ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
When you do 3rd step as @vargtimmen mentioned build fails after transpile.
Then open project from Xcode and select Generic devices and build.Then you can run on any device.
Thanks @vargtimmen you saved my day.