How to use the appium-ios-device.services.startAfcService 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 / ios-deploy.js View on Github external
async pushAppBundle (app, timeout = DEFAULT_ITEM_PUSH_TIMEOUT) {
    const timer = new timing.Timer().start();
    const afcService = await services.startAfcService(this.udid);
    // We are pushing serially due to this https://github.com/appium/appium/issues/13115. There is nothing else we can do besides this
    try {
      const bundlePathOnPhone = await this.createAppPath(afcService, app);
      await fs.walkDir(app, true, async (itemPath, isDir) => {
        const pathOnPhone = path.join(bundlePathOnPhone, path.relative(app, itemPath));
        if (isDir) {
          await afcService.createDirectory(pathOnPhone);
        } else {
          const readStream = fs.createReadStream(itemPath, {autoClose: true});
          const writeStream = await afcService.createWriteStream(pathOnPhone, {autoDestroy: true});
          writeStream.on('finish', writeStream.destroy);
          const itemPushWait = new B((resolve, reject) => {
            writeStream.on('close', resolve);
            const onStreamError = (e) => {
              readStream.unpipe(writeStream);
              reject(e);
github appium / appium-xcuitest-driver / lib / commands / file-movement.js View on Github external
async function createAfcClient (udid, bundleId, containerType) {
  if (!bundleId) {
    return await services.startAfcService(udid);
  }
  const service = await services.startHouseArrestService(udid);
  if (isDocuments(containerType)) {
    return await service.vendDocuments(bundleId);
  } else {
    return await service.vendContainer(bundleId);
  }
}