Closed skypanther closed 10 years ago
I'll need to talk to @cb1kenobi about that. That's part of the ios sim launch process, but perhaps there's a clean way to avoid it.
here's how to do it: https://github.com/appcelerator/ioslib/blob/master/lib/simulator.js#L208
I'm actually working on a PR right now to add a titanium CLI option to skip the activation step, found here: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/hooks/run.js#L125
That'll be easier than pulling in the activation code.
created a TIMOB ticket and submitted PRs to both master and 3_3_X: https://jira.appcelerator.org/browse/TIMOB-17397
Since this is non-critical behavior, I'm OK with requiring TiSDK 3.3.1+ for it. I don't to add special iOS sim handling in here just for the sake of 3.3.0.
In the meantime, if you're up for a quick and dirty hack, you can comment out this small section in your target SDK, my case my 3.3.0.GA SDK:
/*
// focus the simulator
logger.info(__('Focusing the iOS Simulator'));
exec([
'osascript',
'"' + path.join(build.titaniumIosSdkPath, 'iphone_sim_activate.scpt') + '"',
'"' + path.join(build.xcodeEnv.path, 'Platforms', 'iPhoneSimulator.platform', 'Developer', 'Applications', 'iPhone Simulator.app') + '"'
].join(' '), function (err, stdout, stderr) {
if (err) {
logger.error(__('Failed to focus the iPhone Simulator window'));
logger.error(stderr);
}
});
*/
i'm not sure if we can skip activation step without some timeout or something. FWIW
@jhaynie everything works fine skipping that step, it just doesn't focus the simulator. That activate script does nothing more than bring the sim to the foreground.
Also, if you look in the code for the run.js hook, the focus step there is executed asynchronously, but not in any kind of series, meaning nothing in the rest of the execution path is contingent on its completion.
OK, i missed understand.
When launching triple, focus is given to the simulator that's opened. Instead, focus should be returned to your terminal window so that you can more easily start entering commands.