【发布时间】:2015-10-07 00:07:58
【问题描述】:
当我尝试使用 sudo phonegap run ios --verbose 模拟 phonegap/cordova 项目时,我得到了控制台日志:
An error was encountered processing the command (code=146):
Invalid device state
ENOENT, no such file or directory '/Users/<user>/Library/Logs/CoreSimulator/61A2A261-C1D4-4E31-B5DA-4C97191F1656/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/<user>/.../mobile/platforms/ios/build/emulator/Hello World.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-5,--stderr,/Users/<user>/.../mobile/platforms/ios/cordova/console.log,--stdout,/Users/<user>/.../mobile/platforms/ios/cordova/console.log,--exit
Command finished with error code 2: /Users/.../ios/cordova/run --target=iPhone-5
ERROR running one or more of the platforms: Error: /Users/<user>/.../mobile/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
应用程序无法启动。
我可以通过控制台访问ios-sim (v4.1.1)、cordova (v5.1.1) 和phonegap (5.1.1-0.29.0)。
另一个奇怪的事情是,当我在 Intellij 中进入运行配置时,出现警告:Cannot detect ios-sim in path。 XCode 和开发者工具是最新的。我正在使用 Mac OS X Yosemite。有人可以帮我吗?
【问题讨论】:
-
这可能是权限问题,因为您在 phonegap 命令中使用了 sudo。看看这个:zacvineyard.com/blog/2015/11/…
标签: cordova intellij-idea ios-simulator