Skip to content

Commit

Permalink
fix(iOS): Revert ios-deploy removal change for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardasN committed Oct 30, 2024
1 parent 04dfbbc commit 1679e75
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
},
"build/commands/runIOS/index.js": {
"_cliTools().logger.error(`Could not find a device named: \"${_chalk().default.bold(String(deviceName))}\". ${printFoundDevices(devices)}`);": "_cliTools().logger.error(`Could not find a device: \"${_chalk().default.bold(String(deviceName))}\". ${printFoundDevices(devices)}`);\n throw 'Could not find device'; // <= PATCHED BY RENATIVE",
"const isIOSDeployInstalled = _child_process().default.spawnSync('ios-deploy', ['--version'], {\n encoding: 'utf8'\n });\n if (isIOSDeployInstalled.error) {\n throw new (_cliTools().CLIError)(`Failed to install the app on the device because we couldn't execute the \"ios-deploy\" command. Please install it by running \"${_chalk().default.bold('brew install ios-deploy')}\" and try again.`);\n }": "// <= PATCHED BY RENATIVE (removing ios-deploy dependency because of https://github.com/ios-control/ios-deploy/issues/588#issuecomment-1667938056)",
"const iosDeployInstallArgs = ['--bundle', appPath, '--id', selectedDevice.udid, '--justlaunch'];": "// <= PATCHED BY RENATIVE (removing ios-deploy dependency)",
" _cliTools().logger.info(`Installing your app on ${selectedDevice.name}`);": "_cliTools().logger.info(`Installing your app on ${selectedDevice.name}`);",
"const iosDeployOutput = _child_process().default.spawnSync('ios-deploy', iosDeployInstallArgs, {\n encoding: 'utf8'\n });": "const iosInstallArgs = ['devicectl', 'device', 'install', 'app', '--device', selectedDevice.udid, appPath];\n _cliTools().logger.info(`xcrun ${iosInstallArgs.join(' ')}`);\n const iosInstallOutput = _child_process().default.spawnSync('xcrun', iosInstallArgs, {\n stdio: 'pipe',\n encoding: 'utf8',\n });\n const res = JSON.stringify(iosInstallOutput)\n const installationUrl = res.substring(\n res.indexOf('file:') || 0,\n (res.indexOf('.app/') || 0) + '.app/'.length\n );\n _cliTools().logger.info(`Launching your app on ${selectedDevice.name}`);\n const iosLaunchArgs = ['devicectl', 'device', 'process', 'launch', '--device', selectedDevice.udid, installationUrl];\n _cliTools().logger.info(`xcrun ${iosLaunchArgs.join(' ')}`);\n _child_process().default.spawnSync('xcrun', iosLaunchArgs, {\n stdio: 'inherit'\n });",
"if (iosDeployOutput.error) {": "if (iosInstallOutput.stderr) {",
"throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error in \"ios-deploy\" command: ${iosDeployOutput.error.message}`);": "throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error: ${iosInstallOutput.stderr}`);"
"const isIOSDeployInstalled = _child_process().default.spawnSync('ios-deploy', ['--version'], {\n encoding: 'utf8'\n });\n if (isIOSDeployInstalled.error) {\n throw new (_cliTools().CLIError)(`Failed to install the app on the device because we couldn't execute the \"ios-deploy\" command. Please install it by running \"${_chalk().default.bold('brew install ios-deploy')}\" and try again.`); }": "// <= PATCHED BY RENATIVE, remove ios-deploy check",
"const iosDeployInstallArgs = ['--bundle', appPath, '--id', selectedDevice.udid, '--justlaunch'];": " if(!selectedDevice.includes('Apple TV')) {\n const iosDeployInstallArgs = ['--bundle', appPath, '--id', selectedDevice.udid, '--justlaunch'];",
"if (iosDeployOutput.error) {\n throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error in \"ios-deploy\" command: ${iosDeployOutput.error.message}`);\n }": "if (iosDeployOutput.error) {\n throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error in \"ios-deploy\" command: ${iosDeployOutput.error.message}`);\n }} else {\n _cliTools().logger.info(`Installing your app on ${selectedDevice.name}`);\n const iosInstallArgs = ['devicectl', 'device', 'install', 'app', '--device', selectedDevice.udid, appPath];\n _cliTools().logger.info(`xcrun ${iosInstallArgs.join(' ')}`);\n const iosInstallOutput = _child_process().default.spawnSync('xcrun', iosInstallArgs, {\n stdio: 'pipe',\n encoding: 'utf8',\n });\n const res = JSON.stringify(iosInstallOutput);\n const installationUrl = res.substring(\n res.indexOf('file:') || 0,\n (res.indexOf('.app/') || 0) + '.app/'.length\n );\n _cliTools().logger.info(`Launching your app on ${selectedDevice.name}`);\n const iosLaunchArgs = ['devicectl', 'device', 'process', 'launch', '--device', selectedDevice.udid, installationUrl];\n _cliTools().logger.info(`xcrun ${iosLaunchArgs.join(' ')}`);\n _child_process().default.spawnSync('xcrun', iosLaunchArgs, {\n stdio: 'inherit'\n });\n if (iosInstallOutput.stderr) {\n throw new (_cliTools().CLIError)(`Failed to install the app on the device. We've encountered an error: ${iosInstallOutput.stderr}`);\n }\n }"
}
}
}

0 comments on commit 1679e75

Please sign in to comment.