Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async isAppInstalled (bundleId) {
try {
const appContainer = await getAppContainer(this.udid, bundleId, false);
return appContainer.endsWith('.app');
} catch (err) {
// get_app_container subcommand fails for system applications,
// so we try the hidden appinfo subcommand, which prints correct info for
// system/hidden apps
try {
const info = await appInfo(this.udid, bundleId);
return info.includes('ApplicationType');
} catch (e) {
return false;
}
}
}