How to use the appium-support.plist.parsePlist function in appium-support

To help you get started, we’ve selected a few appium-support 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 / wda / webdriveragent.js View on Github external
async parseBundleId (wdaBundlePath) {
    const infoPlistPath = path.join(wdaBundlePath, 'Info.plist');
    const infoPlist = await plist.parsePlist(await fs.readFile(infoPlistPath));
    if (!infoPlist.CFBundleIdentifier) {
      throw new Error(`Couldn't find bundle id in ${infoPlistPath}`);
    }
    return infoPlist.CFBundleIdentifier;
  }
github appium / appium-remote-debugger / bin / web_inspector_proxy.js View on Github external
.trim()
      .replace(/(\r\n|\n|\r)/gm, ' ')
      .split(' ')
      .map((str) => str.trim())
      .filter((str) => str !== '');

    arr = arr.slice(4);
    const data = arr
      .map((str) => parseInt(str, 16));
    if (data.length === 0) {
      console.log('no data');
      return;
    }
    const buf = Buffer.from(data);
    try {
      const doc = plist.parsePlist(buf);
      console.log(util.jsonStringify(doc));
    } catch (err) {
      if (err.message.includes('maxObjectCount exceeded')) {
        return str;
      }
      console.log('ERROR:', err.message);
    }
  }
  return '';
}
github appium / appium-ios-device / lib / usbmux / index.js View on Github external
async readPairRecord (udid, timeout = 5000) {
    const { tag, receivePromise } = this._receivePlistPromise(timeout);

    this._sendPlist({
      tag,
      payload: {
        MessageType: 'ReadPairRecord',
        PairRecordID: udid,
        ProgName: PROG_NAME,
        ClientVersionString: CLIENT_VERSION_STRING
      }
    });
    const data = await receivePromise;
    if (data.payload.PairRecordData) {
      try {
        return plist.parsePlist(data.payload.PairRecordData);
      } catch (err) {
        throw new Error(`Unexpected data: ${JSON.stringify(data)}`);
      }
    } else {
      return null;
    }
  }
github appium / appium-ios-device / lib / usbmux / transformer / usbmux-decoder.js View on Github external
_decode (data) {
    const header = {
      length: data.readUInt32LE(0),
      version: data.readUInt32LE(4),
      type: data.readUInt32LE(8),
      tag: data.readUInt32LE(12)
    };

    let payload = data.slice(HEADER_LENGTH, data.length);
    this.push({ header, payload: plist.parsePlist(payload) });
  }
github appium / appium-ios-device / lib / plist-service / transformer / plist-service-decoder.js View on Github external
_decode (data) {
    const payload = data.slice(HEADER_LENGTH, data.length);
    if (_.isEmpty(payload)) {
      return;
    }
    const object = plist.parsePlist(payload);
    if (!object) {
      return;
    }
    this.push(object);
  }
}