Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
timer = setTimeout(function () {
// logs quieted down, go ahead and install
state = INSTALLING;
iosDevice.installApp(udid, appPath, function (err) {
if (err) {
emitter.emit('error', err);
trackOff();
logOff && logOff();
} else {
emitter.emit('installed');
}
callback(err);
});
}, 500);
} else if (state == INSTALLING) {
return magik(options, null, function (handle, options) {
if (!appPath) {
return handle.emit('error', new Error(__('Missing app path argument')));
}
if (!fs.existsSync(appPath)) {
return handle.emit('error', new Error(__('App path does not exist: ' + appPath)));
}
handle.stop = function () {}; // for stopping logging
iosDevice.installApp(udid, appPath, function (err) {
if (err) {
return handle.emit('error', err);
}
handle.emit('installed');
if (options.logPort) {
var logHandle = iosDevice
.log(udid, options.logPort)
.on('log', function (msg) {
handle.emit('log', msg);
})
.on('app-started', function () {
handle.emit('app-started');
})
.on('app-quit', function () {