Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await stopTunnelsAsync(projectRoot);
if (await Android.startAdbReverseAsync(projectRoot)) {
ProjectUtils.logInfo(
projectRoot,
'expo',
'Successfully ran `adb reverse`. Localhost urls should work on the connected Android device.',
'project-adb-reverse'
);
} else {
ProjectUtils.clearNotification(projectRoot, 'project-adb-reverse');
}
const { username } = user;
let packageShortName = path.parse(projectRoot).base;
let expRc = await ProjectUtils.readExpRcAsync(projectRoot);
ngrok.addListener('statuschange', status => {
if (status === 'reconnecting') {
ProjectUtils.logError(
projectRoot,
'expo',
'We noticed your tunnel is having issues. This may be due to intermittent problems with our tunnel provider. If you have trouble connecting to your app, try to Restart the project, or switch Host to LAN.'
);
} else if (status === 'online') {
ProjectUtils.logInfo(projectRoot, 'expo', 'Tunnel connected.');
}
});
try {
let startedTunnelsSuccessfully = false;
// Some issues with ngrok cause it to hang indefinitely. After
// TUNNEL_TIMEOUTms we just throw an error.
ngrokPid: ngrok.process().pid,
});
startedTunnelsSuccessfully = true;
ProjectUtils.logWithLevel(
projectRoot,
'info',
{
tag: 'expo',
_expoEventType: 'TUNNEL_READY',
},
'Tunnel ready.'
);
ngrok.addListener('statuschange', status => {
if (status === 'reconnecting') {
ProjectUtils.logError(
projectRoot,
'expo',
'We noticed your tunnel is having issues. ' +
'This may be due to intermittent problems with our tunnel provider. ' +
'If you have trouble connecting to your app, try to Restart the project, ' +
'or switch Host to LAN.'
);
} else if (status === 'online') {
ProjectUtils.logInfo(projectRoot, 'expo', 'Tunnel connected.');
}
});
})(),
]);
ngrokPid: ngrok.process().pid,
});
startedTunnelsSuccessfully = true;
ProjectUtils.logWithLevel(
projectRoot,
'info',
{
tag: 'expo',
_expoEventType: 'TUNNEL_READY',
},
'Tunnel ready.'
);
ngrok.addListener('statuschange', (status: string) => {
if (status === 'reconnecting') {
ProjectUtils.logError(
projectRoot,
'expo',
'We noticed your tunnel is having issues. ' +
'This may be due to intermittent problems with our tunnel provider. ' +
'If you have trouble connecting to your app, try to Restart the project, ' +
'or switch Host to LAN.'
);
} else if (status === 'online') {
ProjectUtils.logInfo(projectRoot, 'expo', 'Tunnel connected.');
}
});
})(),
]);