diff --git a/lib/commands/file-movement.js b/lib/commands/file-movement.js index 965d95b41..68535c932 100644 --- a/lib/commands/file-movement.js +++ b/lib/commands/file-movement.js @@ -318,13 +318,16 @@ async function pullFromRealDevice (device, remotePath, isFile) { /** * Get bundleIds which can mount by `--documents` flag * + * * @param {Object} udid - The udid of the target device - * @returns {Array} A list of bundle ids + * @returns {Array} A list of User level apps' bundle ids which has + * 'UIFileSharingEnabled' attribute. + * Only user apps might have it. */ async function getAvailableBundleIds (udid) { const service = await services.startInstallationProxyService(udid); try { - const applications = await service.listApplications(); + const applications = await service.listApplications({applicationType: 'User'}); const bundleIds = []; for (const [key, value] of Object.entries(applications)) { if (!value.UIFileSharingEnabled) { diff --git a/lib/ios-deploy.js b/lib/ios-deploy.js index abc2bca04..bd1e3b382 100644 --- a/lib/ios-deploy.js +++ b/lib/ios-deploy.js @@ -100,6 +100,18 @@ class IOSDeploy { await this.install(app); } + /** + * Return an application object if test app has 'bundleid'. + * The target bundleid can be User and System apps. + * @param {string} bundleid The bundleId to ensure it is installed + * @return {boolean} Returns True if the bundleid exists in the result of 'listApplications' like: + * { "com.apple.Preferences":{ + * "UIRequiredDeviceCapabilities":["arm64"], + * "UIRequiresFullScreen":true, + * "CFBundleInfoDictionaryVersion":"6.0", + * "Entitlements": + * {"com.apple.frontboard.delete-application-snapshots":true,.. + */ async isAppInstalled (bundleid) { const service = await services.startInstallationProxyService(this.udid); try {