Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async installApplication (bundlePathOnPhone) {
const notificationService = await services.startNotificationProxyService(this.udid);
const installationService = await services.startInstallationProxyService(this.udid);
const appInstalledNotification = new B((resolve) => {
notificationService.observeNotification(APPLICATION_INSTALLED_NOTIFICATION, {notification: resolve});
});
try {
await installationService.installApplication(bundlePathOnPhone, {PackageType: 'Developer'});
try {
await appInstalledNotification.timeout(APPLICATION_NOTIFICATION_TIMEOUT, `Could not get the application installed notification within ${APPLICATION_NOTIFICATION_TIMEOUT}ms but we will continue`);
} catch (e) {
log.warn(`Failed to receive the notification. Error: ${e.message}`);
}
} finally {
installationService.close();
notificationService.close();
}
}