Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return emitter;
}
var appName = options.appName || path.basename(appPath).replace(/\.app$/, ''),
installedRegExp = new RegExp(' installd\\[.* Installing .*' + appId),
logRegExp = new RegExp(' ' + appName + '\\[(\\d+)\\][^:]+: (.*)'),
quitRegExp = new RegExp(' backboardd\\[[^:]+: Application .+\\:' + appId + '\\['),
lastLineWasOurs = false,
PUMPING_LOG = 1,
INSTALLING = 2,
INSTALLED = 3,
RUNNING = 4,
state = PUMPING_LOG,
timer = null,
logOff,
trackOff = iosDevice.trackDevices(function (err, devices) {
if (!devices.some(function (device) { return device.udid === udid; })) {
trackOff();
logOff && logOff();
if (state === RUNNING) {
emitter.emit('app-quit');
}
emitter.emit('disconnect');
}
});
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
export function trackDevices() {
return new TrackDeviceHandle(iosDevice.trackDevices());
}