Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
process.nextTick(function () {
try {
logOff = iosDevice.log(udid, function (msg) {
if (state == PUMPING_LOG) {
// we create a timer here so that if we haven't received any messages for a
// half second, then the log must be caught up and we're ready to install
clearTimeout(timer);
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);
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 () {
handle.emit('app-quit');
})
.on('disconnect', function () {
handle.emit('disconnect');
})
.on('error', function (err) {
handle.emit('log-error', err);
});