How to use the appium-ios-device.utilities.getDeviceName function in appium-ios-device

To help you get started, we’ve selected a few appium-ios-device examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-xcuitest-driver / lib / device-log / ios-crash-log.js View on Github external
async getCrashes () {
    let crashLogsRoot = this.logDir;
    if (this.udid) {
      this.phoneName = this.phoneName || await utilities.getDeviceName(this.udid);
      crashLogsRoot = path.resolve(crashLogsRoot, this.phoneName);
    }
    if (!await fs.exists(crashLogsRoot)) {
      log.debug(`Crash reports root '${crashLogsRoot}' does not exist. Got nothing to gather.`);
      return [];
    }
    const foundFiles = await fs.glob(`${crashLogsRoot}/**/*.crash`);
    if (this.udid) {
      return foundFiles;
    }
    // For Simulator only include files, that contain current UDID
    return await B.filter(foundFiles, async (x) => {
      try {
        const content = await fs.readFile(x, 'utf8');
        return content.toUpperCase().includes(this.sim.udid.toUpperCase());
      } catch (err) {