我更新了Xcode。不确定这是否是问题,但它是问题开始的地方。 但长话短说:
- “$ cordova emulate android
”有效
- “$ cordova emulate ios
”不起作用
它给了我(这是输出的最后一部分):
** BUILD SUCCEEDED **
2014-10-03 16:35:53.054 ios-sim[74808:507] stderrPath: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/console.log
2014-10-03 16:35:53.055 ios-sim[74808:507] stdoutPath: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/console.log
2014-10-03 16:35:53.085 ios-sim[74808:507] -[__NSArrayM localizedDescription]: unrecognized selector sent to instance 0x7fea40503090
2014-10-03 16:35:53.086 ios-sim[74808:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM localizedDescription]: unrecognized selector sent to instance 0x7fea40503090'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff98e1025c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8cc4ee75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff98e1312d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff98d6e272 ___forwarding___ + 1010
4 CoreFoundation 0x00007fff98d6ddf8 _CF_forwarding_prep_0 + 120
5 ios-sim 0x00000001014b8e29 -[iPhoneSimulator LoadSimulatorFramework:] + 245
6 ios-sim 0x00000001014ba8e0 -[iPhoneSimulator runWithArgc:argv:] + 2271
7 ios-sim 0x00000001014bacb2 main + 101
8 ios-sim 0x00000001014b8ce4 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
/Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/run: line 158: 74808 Abort trap: 6 ios-sim launch "$SIMULATOR_APP_PATH" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log" $TARGET_FLAG --exit
Error: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/run: Command failed with exit code 134
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
但是,我可以从Xcode本身运行模拟器。
我不知道该怎么做,我希望有人可以提供帮助。
答案 0 :(得分:3)
对于Xcode 6,您需要ios-sim的第3版。运行ios-sim --version
检查您的版本。通过运行sudo npm update ios-sim -g
进行升级。