简体   繁体   English

离子/ cordova项目中的Xcode设备列表为空

[英]Xcode device list is empty in ionic/cordova project

No matter what I try I can't get access to the Xcode simulators from my ionic/cordova project. 无论我尝试什么,我都无法从我的离子/ cordova项目访问Xcode模拟器。 Xcode Command Line Tool is installed. 已安装Xcode命令行工具。

cordova run ios --list

returns 回报

Available ios devices: 可用的ios设备:

Available ios virtual devices: 可用的ios虚拟设备:

ionic cordova emulate ios --list

returns 回报

Available ios virtual devices: 可用的ios虚拟设备:

I have all the simulators in Xcode and it's working fine when Im opening the project in Xcode and run the simulators manually. 我在Xcode中拥有所有模拟器,当我在Xcode中打开项目并手动运行模拟器时,它工作正常。

The consequences of this is that I cant run my app with livereload from the terminal: 这样做的后果是我无法通过终端的livereload运行我的应用程序:

ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1"

returns 回报

Device id for device name "iPhone X" and runtime "iOS 12.1" could not be found, or is not available. 无法找到或无法使用设备名称“iPhone X”和运行时“iOS 12.1”的设备ID。

在此输入图像描述

This is a bug related to the new version of XCode. 这是与新版XCode相关的错误。 I had the same problem. 我有同样的问题。 I would advise you to uninstall and reinstall XCode but I don't think it will work. 我建议你卸载并重新安装XCode,但我认为它不会起作用。

I solved (dirty fix) my problem by applying what ejerskov says here: https://github.com/ios-control/ios-sim/issues/246 我通过应用ejerskov在这里说的解决了(脏修复)我的问题: https//github.com/ios-control/ios-sim/issues/246

On platforms/ios/cordova/node_modules/ios-sim/src/lib.js platforms/ios/cordova/node_modules/ios-sim/src/lib.js

I have changed 我变了

available_runtimes[ runtime.name ] = (runtime.availability === '(available)');

to

available_runtimes[ runtime.identifier ] = (runtime.availability === '(available)');

Otherwise I think we should wait for a new release of ios-sim and cordova-ios... 否则我认为我们应该等待ios-sim和cordova-ios的新发布......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM