Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
.on('exit', function () {
// no need to stick around, exit
})
.on('error', function (err) {
logger.error(err.message || err.toString());
logger.log();
});
} else if (target === 'device') {
// TODO: device
var appName = this.tiapp.name + '.app',
appPath = path.join(this.buildDir, 'build', 'iphone', 'build', 'Debug-iphoneos', appName);
emitter = ioslib.device.install(this.deviceInfo.udid, appPath, this.tiapp.id)
.on('installed', function (line) {
logger['tio2-warn'](appName + ' installed, but cannot be launched automatically!!!');
})
.on('app-started', function (line) {
logger['tio2-debug']('-- app-started');
})
.on('log', function (line) {
line = line.replace(logLevelRegExp, '');
if (line === self.tiTestStartMarker) {
inTiMochaResult = true;
} else if (inTiMochaResult && line === self.tiTestStopMarker) {
emitter.removeListener('log', watch);
emitter.removeListener('logFile', watch);
try {
self.results = tiMochaResults.length ? JSON.parse(tiMochaResults.join('\n').trim()) : {};
next();
function (cb) {
// add iOS args
if (this.platform !== 'ios') { return cb(); }
this.iosVersion && args.push('--ios-version', this.iosVersion);
if (this.target !== 'device') {
return cb();
}
// find us a device
ioslib.device.detect(function (err, deviceResults) {
if (!deviceResults.devices.length) {
// no devices connected
return done(new Error('No iOS devices connected'));
}
ioslib.certs.detect(function (err, certResults) {
var certs = [];
Object.keys(certResults.certs.keychains).forEach(function (keychain) {
var types = certResults.certs.keychains[keychain];
Object.keys(types).forEach(function (type) {
certs = certs.concat(types[type]);
});
});
if (!certs.length) {
return cb(new Error('No iOS certificates'));