-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: uninstall wda with '.xctrunner' suffix for real device #1052
Changes from 2 commits
56595d4
d2c5fb1
e16a362
6588ae0
5b18d3e
9ab2c3e
9186503
7c5e41d
24078cd
6c8523b
0142675
c7beac7
ba1c56d
fa771f9
df279bd
cbd3745
91c31b2
74c0314
cc866f9
7e8150e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import B from 'bluebird'; | ||
import path from 'path'; | ||
import { getSimulator } from 'appium-ios-simulator'; | ||
import { createDevice, getDevices, terminate, shutdown } from 'node-simctl'; | ||
|
@@ -216,11 +217,11 @@ async function shutdownOtherSimulators (currentDevice) { | |
|
||
async function getInstalledBundleIds (device, candidateBundleIds) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we actually change this in appium-ios-simulator that we get a similar api like what the real devices have? This would help us get rid of having a list of potential bundle ids There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can either add this call to ios simulator or we can attach it to the object dynamically right in this module:
Then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm talking about something else. I'm talking about making this method similar as the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this is an oneliner then we could simply move it to |
||
const bundleIds = []; | ||
mykola-mokhnach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for (const bundleId of candidateBundleIds) { | ||
await B.filter(candidateBundleIds, async (bundleId) => { | ||
if (await device.isAppInstalled(bundleId)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not really - the filter condition should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and the result could be returned immediately. There is no need for the intermediate accumulator |
||
bundleIds.push(bundleId); | ||
} | ||
} | ||
}); | ||
return bundleIds; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import B from 'bluebird'; | ||
import _ from 'lodash'; | ||
import path from 'path'; | ||
import url from 'url'; | ||
|
@@ -12,7 +13,7 @@ import iProxy from './iproxy'; | |
import { exec } from 'teen_process'; | ||
import AsyncLock from 'async-lock'; | ||
import { BOOTSTRAP_PATH, WDA_BUNDLE_ID, WDA_RUNNER_BUNDLE_ID, checkForDependencies } from 'appium-webdriveragent'; | ||
import { getIBundleIdsByCFBundleName } from '../real-device-management'; | ||
import { getBundleIdsByBundleName } from '../real-device-management'; | ||
import { getInstalledBundleIds } from '../simulator-management'; | ||
|
||
const WDA_LAUNCH_TIMEOUT = 60 * 1000; | ||
|
@@ -174,9 +175,9 @@ class WebDriverAgent { | |
} | ||
|
||
log.debug(`Uninstalling WDAs: '${bundleIds}'`); | ||
for (const bundleId of bundleIds) { | ||
await B.each(bundleIds, async (bundleId) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here I would revert back to |
||
await this.device.removeApp(bundleId); | ||
} | ||
}); | ||
} catch (e) { | ||
log.warn(`WebDriverAgent uninstall failed. Perhaps, it is already uninstalled? Original error: ${JSON.stringify(e)}`); | ||
} | ||
|
@@ -422,7 +423,7 @@ class WebDriverAgent { | |
*/ | ||
async getInstalledWDBundleId () { | ||
return this.isRealDevice | ||
? await getIBundleIdsByCFBundleName(this.device, WDA_CF_BUNDLE_NAME) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so how about moving these methods into corresponding classes and make it polymorphic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. I also thought we can get |
||
? await getBundleIdsByBundleName(this.device, WDA_CF_BUNDLE_NAME) | ||
: await getInstalledBundleIds(this.device, [WDA_BUNDLE_ID, WDA_BUNDLE_ID_XCODE11]); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, lets move this method into IOSDeploy class