@expo/cli 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +89 -4
- package/build/bin/cli.map +1 -1
- package/build/src/api/rest/wrapFetchWithOffline.js +2 -23
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
- package/build/src/customize/customizeAsync.js +40 -0
- package/build/src/customize/customizeAsync.js.map +1 -0
- package/build/src/customize/generate.js +77 -0
- package/build/src/customize/generate.js.map +1 -0
- package/build/src/customize/index.js +41 -0
- package/build/src/customize/index.js.map +1 -0
- package/build/src/customize/resolveOptions.js +18 -0
- package/build/src/customize/resolveOptions.js.map +1 -0
- package/build/src/customize/templates.js +118 -0
- package/build/src/customize/templates.js.map +1 -0
- package/build/src/export/createMetadataJson.js +10 -7
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/exportApp.js +32 -0
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +2 -3
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +51 -34
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/index.js +15 -10
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/printBundleSizes.js +27 -48
- package/build/src/export/printBundleSizes.js.map +1 -1
- package/build/src/export/resolveOptions.js +44 -5
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +2 -1
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +37 -0
- package/build/src/export/web/exportWebAsync.js.map +1 -0
- package/build/src/export/web/index.js +66 -0
- package/build/src/export/web/index.js.map +1 -0
- package/build/src/export/web/resolveOptions.js +13 -0
- package/build/src/export/web/resolveOptions.js.map +1 -0
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/checkPackages.js +2 -1
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/index.js +1 -0
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +13 -5
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/resolveOptions.js +12 -65
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js +5 -26
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
- package/build/src/log.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +5 -23
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/index.js +18 -12
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +11 -12
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +17 -0
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/resolveTemplate.js +2 -1
- package/build/src/prebuild/resolveTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +5 -5
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/run/android/resolveInstallApkName.js +5 -26
- package/build/src/run/android/resolveInstallApkName.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +3 -3
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ensureNativeProject.js +3 -0
- package/build/src/run/ensureNativeProject.js.map +1 -1
- package/build/src/run/hints.js +1 -1
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +275 -0
- package/build/src/run/ios/XcodeBuild.js.map +1 -0
- package/build/src/run/ios/XcodeBuild.types.js +6 -0
- package/build/src/run/ios/XcodeBuild.types.js.map +1 -0
- package/build/src/run/ios/appleDevice/AppleDevice.js +161 -0
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -0
- package/build/src/run/ios/appleDevice/ClientManager.js +161 -0
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/AFCClient.js +195 -0
- package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js +107 -0
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +97 -0
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +140 -0
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js +91 -0
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/ServiceClient.js +21 -0
- package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +117 -0
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -0
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +90 -0
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -0
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +332 -0
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -0
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +115 -0
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -0
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +126 -0
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -0
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +74 -0
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -0
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js +65 -0
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js.map +1 -0
- package/build/src/run/ios/codeSigning/Security.js +85 -0
- package/build/src/run/ios/codeSigning/Security.js.map +1 -0
- package/build/src/run/ios/codeSigning/configureCodeSigning.js +77 -0
- package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -0
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +102 -0
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -0
- package/build/src/run/ios/codeSigning/settings.js +21 -0
- package/build/src/run/ios/codeSigning/settings.js.map +1 -0
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +76 -0
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -0
- package/build/src/run/ios/index.js +98 -0
- package/build/src/run/ios/index.js.map +1 -0
- package/build/src/run/ios/launchApp.js +75 -0
- package/build/src/run/ios/launchApp.js.map +1 -0
- package/build/src/run/ios/options/promptDevice.js +50 -0
- package/build/src/run/ios/options/promptDevice.js.map +1 -0
- package/build/src/run/ios/options/resolveDevice.js +92 -0
- package/build/src/run/ios/options/resolveDevice.js.map +1 -0
- package/build/src/run/ios/options/resolveNativeScheme.js +92 -0
- package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -0
- package/build/src/run/ios/options/resolveOptions.js +44 -0
- package/build/src/run/ios/options/resolveOptions.js.map +1 -0
- package/build/src/run/ios/options/resolveXcodeProject.js +39 -0
- package/build/src/run/ios/options/resolveXcodeProject.js.map +1 -0
- package/build/src/run/ios/runIosAsync.js +85 -0
- package/build/src/run/ios/runIosAsync.js.map +1 -0
- package/build/src/run/resolveBundlerProps.js +9 -6
- package/build/src/run/resolveBundlerProps.js.map +1 -1
- package/build/src/run/startBundler.js +4 -2
- package/build/src/run/startBundler.js.map +1 -1
- package/build/src/start/doctor/Prerequisite.js +4 -4
- package/build/src/start/doctor/Prerequisite.js.map +1 -1
- package/build/src/start/doctor/SecurityBinPrerequisite.js +27 -0
- package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +2 -0
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js +69 -0
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js.map +1 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js +2 -0
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +3 -2
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +7 -13
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getMissingPackages.js +3 -24
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +2 -23
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +17 -9
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +2 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +4 -3
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +32 -31
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
- package/build/src/start/interface/KeyPressHandler.js +2 -0
- package/build/src/start/interface/KeyPressHandler.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +5 -5
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/interface/startInterface.js +3 -2
- package/build/src/start/interface/startInterface.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js +2 -1
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js +4 -24
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/ADBServer.js +17 -32
- package/build/src/start/platforms/android/ADBServer.js.map +1 -1
- package/build/src/start/platforms/android/AndroidSdk.js +41 -0
- package/build/src/start/platforms/android/AndroidSdk.js.map +1 -0
- package/build/src/start/platforms/android/activateWindow.js +4 -4
- package/build/src/start/platforms/android/activateWindow.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +8 -3
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/adbReverse.js +3 -2
- package/build/src/start/platforms/android/adbReverse.js.map +1 -1
- package/build/src/start/platforms/android/emulator.js +8 -0
- package/build/src/start/platforms/android/emulator.js.map +1 -1
- package/build/src/start/platforms/android/gradle.js +2 -2
- package/build/src/start/platforms/android/gradle.js.map +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js +1 -5
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +5 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +4 -4
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js +1 -5
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
- package/build/src/start/platforms/ios/simctl.js +14 -0
- package/build/src/start/platforms/ios/simctl.js.map +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js +220 -0
- package/build/src/start/platforms/ios/simctlLogging.js.map +1 -0
- package/build/src/start/platforms/ios/xcrun.js +2 -23
- package/build/src/start/platforms/ios/xcrun.js.map +1 -1
- package/build/src/start/project/devices.js +2 -0
- package/build/src/start/project/devices.js.map +1 -1
- package/build/src/start/server/AsyncNgrok.js +6 -5
- package/build/src/start/server/AsyncNgrok.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +15 -8
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +15 -5
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevelopmentSession.js +4 -0
- package/build/src/start/server/DevelopmentSession.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +10 -3
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +9 -0
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +5 -0
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +11 -1
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/resolveFromProject.js +8 -0
- package/build/src/start/server/metro/resolveFromProject.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +115 -0
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -0
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
- package/build/src/start/server/middleware/ExpoMiddleware.js +9 -4
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/HistoryFallbackMiddleware.js +24 -0
- package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +2 -0
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +57 -6
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +6 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js +62 -0
- package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -0
- package/build/src/start/server/platformBundlers.js +18 -0
- package/build/src/start/server/platformBundlers.js.map +1 -0
- package/build/src/start/server/webTemplate.js +68 -0
- package/build/src/start/server/webTemplate.js.map +1 -0
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +59 -19
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/start/server/webpack/compile.js +64 -0
- package/build/src/start/server/webpack/compile.js.map +1 -0
- package/build/src/start/startAsync.js +21 -17
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/utils/FileNotifier.js +5 -2
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +30 -3
- package/build/src/utils/analytics/rudderstackClient.js.map +1 -1
- package/build/src/utils/cocoapods.js +47 -0
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/dir.js +6 -1
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js +3 -2
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +7 -32
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +3 -2
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +3 -0
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/exit.js +4 -25
- package/build/src/utils/exit.js.map +1 -1
- package/build/src/utils/getRunningProcess.js +6 -2
- package/build/src/utils/getRunningProcess.js.map +1 -1
- package/build/src/utils/nodeModules.js +13 -102
- package/build/src/utils/nodeModules.js.map +1 -1
- package/build/src/utils/npm.js +3 -24
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/ora.js +1 -13
- package/build/src/utils/ora.js.map +1 -1
- package/build/src/utils/plist.js +59 -0
- package/build/src/utils/plist.js.map +1 -0
- package/build/src/utils/progress.js +46 -0
- package/build/src/utils/progress.js.map +1 -1
- package/build/src/utils/prompts.js +19 -3
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/resolveArgs.js +4 -1
- package/build/src/utils/resolveArgs.js.map +1 -1
- package/build/src/utils/tar.js +3 -0
- package/build/src/utils/tar.js.map +1 -1
- package/build/src/utils/terminal.js +10 -0
- package/build/src/utils/terminal.js.map +1 -0
- package/build/src/utils/validateApplicationId.js +9 -2
- package/build/src/utils/validateApplicationId.js.map +1 -1
- package/build/src/utils/variadic.js +47 -0
- package/build/src/utils/variadic.js.map +1 -0
- package/package.json +14 -10
- package/static/template/babel.config.js +6 -0
- package/static/template/index.html +117 -0
- package/static/template/metro.config.js +4 -0
- package/static/template/serve.json +13 -0
- package/static/template/webpack.config.js +7 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.logPrettyItem = logPrettyItem;
|
|
6
|
+
exports.getAppBinaryPath = getAppBinaryPath;
|
|
7
|
+
exports.getEscapedPath = getEscapedPath;
|
|
8
|
+
exports.extractEnvVariableFromBuild = extractEnvVariableFromBuild;
|
|
9
|
+
exports.getProcessOptions = getProcessOptions;
|
|
10
|
+
exports.getXcodeBuildArgsAsync = getXcodeBuildArgsAsync;
|
|
11
|
+
exports.buildAsync = buildAsync;
|
|
12
|
+
exports._assertXcodeBuildResults = _assertXcodeBuildResults;
|
|
13
|
+
var _xcpretty = require("@expo/xcpretty");
|
|
14
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
15
|
+
var _childProcess = require("child_process");
|
|
16
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
17
|
+
var _os = _interopRequireDefault(require("os"));
|
|
18
|
+
var _path = _interopRequireDefault(require("path"));
|
|
19
|
+
var Log = _interopRequireWildcard(require("../../log"));
|
|
20
|
+
var _dir = require("../../utils/dir");
|
|
21
|
+
var _env = require("../../utils/env");
|
|
22
|
+
var _errors = require("../../utils/errors");
|
|
23
|
+
var _terminal = require("../../utils/terminal");
|
|
24
|
+
var _configureCodeSigning = require("./codeSigning/configureCodeSigning");
|
|
25
|
+
function _interopRequireDefault(obj) {
|
|
26
|
+
return obj && obj.__esModule ? obj : {
|
|
27
|
+
default: obj
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _interopRequireWildcard(obj) {
|
|
31
|
+
if (obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
} else {
|
|
34
|
+
var newObj = {};
|
|
35
|
+
if (obj != null) {
|
|
36
|
+
for(var key in obj){
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
38
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
39
|
+
if (desc.get || desc.set) {
|
|
40
|
+
Object.defineProperty(newObj, key, desc);
|
|
41
|
+
} else {
|
|
42
|
+
newObj[key] = obj[key];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
newObj.default = obj;
|
|
48
|
+
return newObj;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function logPrettyItem(message) {
|
|
52
|
+
Log.log(_chalk.default`{whiteBright \u203A} ${message}`);
|
|
53
|
+
}
|
|
54
|
+
function getAppBinaryPath(buildOutput) {
|
|
55
|
+
// Matches what's used in "Bundle React Native code and images" script.
|
|
56
|
+
// Requires that `-hideShellScriptEnvironment` is not included in the build command (extra logs).
|
|
57
|
+
// Like `\=/Users/evanbacon/Library/Developer/Xcode/DerivedData/Exponent-anpuosnglkxokahjhfszejloqfvo/Build/Products/Debug-iphonesimulator`
|
|
58
|
+
const CONFIGURATION_BUILD_DIR = extractEnvVariableFromBuild(buildOutput, "CONFIGURATION_BUILD_DIR").sort(// Longer name means more suffixes, we want the shortest possible one to be first.
|
|
59
|
+
// Massive projects (like Expo Go) can sometimes print multiple different sets of environment variables.
|
|
60
|
+
// This can become an issue with some
|
|
61
|
+
(a, b)=>a.length - b.length
|
|
62
|
+
);
|
|
63
|
+
// Like `Exponent.app`
|
|
64
|
+
const UNLOCALIZED_RESOURCES_FOLDER_PATH = extractEnvVariableFromBuild(buildOutput, "UNLOCALIZED_RESOURCES_FOLDER_PATH");
|
|
65
|
+
const binaryPath = _path.default.join(// Use the shortest defined env variable (usually there's just one).
|
|
66
|
+
CONFIGURATION_BUILD_DIR[0], // Use the last defined env variable.
|
|
67
|
+
UNLOCALIZED_RESOURCES_FOLDER_PATH[UNLOCALIZED_RESOURCES_FOLDER_PATH.length - 1]);
|
|
68
|
+
// If the app has a space in the name it'll fail because it isn't escaped properly by Xcode.
|
|
69
|
+
return getEscapedPath(binaryPath);
|
|
70
|
+
}
|
|
71
|
+
function getEscapedPath(filePath) {
|
|
72
|
+
if (_fs.default.existsSync(filePath)) {
|
|
73
|
+
return filePath;
|
|
74
|
+
}
|
|
75
|
+
const unescapedPath = filePath.split(/\\ /).join(" ");
|
|
76
|
+
if (_fs.default.existsSync(unescapedPath)) {
|
|
77
|
+
return unescapedPath;
|
|
78
|
+
}
|
|
79
|
+
throw new _errors.CommandError("XCODE_BUILD", `Unexpected: Generated app at path "${filePath}" cannot be read, the app cannot be installed. Please report this and build onto a simulator.`);
|
|
80
|
+
}
|
|
81
|
+
function extractEnvVariableFromBuild(buildOutput, variableName) {
|
|
82
|
+
// Xcode can sometimes escape `=` with a backslash or put the value in quotes
|
|
83
|
+
const reg = new RegExp(`export ${variableName}\\\\?=(.*)$`, "mg");
|
|
84
|
+
const matched = [
|
|
85
|
+
...buildOutput.matchAll(reg)
|
|
86
|
+
];
|
|
87
|
+
if (!matched || !matched.length) {
|
|
88
|
+
throw new _errors.CommandError("XCODE_BUILD", `Malformed xcodebuild results: "${variableName}" variable was not generated in build output. Please report this issue and run your project with Xcode instead.`);
|
|
89
|
+
}
|
|
90
|
+
return matched.map((value)=>value[1]
|
|
91
|
+
).filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
function getProcessOptions({ packager , shouldSkipInitialBundling , terminal , port }) {
|
|
94
|
+
const SKIP_BUNDLING = shouldSkipInitialBundling ? "1" : undefined;
|
|
95
|
+
if (packager) {
|
|
96
|
+
return {
|
|
97
|
+
env: {
|
|
98
|
+
...process.env,
|
|
99
|
+
RCT_TERMINAL: terminal,
|
|
100
|
+
SKIP_BUNDLING,
|
|
101
|
+
RCT_METRO_PORT: port.toString()
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
env: {
|
|
107
|
+
...process.env,
|
|
108
|
+
RCT_TERMINAL: terminal,
|
|
109
|
+
SKIP_BUNDLING,
|
|
110
|
+
// Always skip launching the packager from a build script.
|
|
111
|
+
// The script is used for people building their project directly from Xcode.
|
|
112
|
+
// This essentially means "› Running script 'Start Packager'" does nothing.
|
|
113
|
+
RCT_NO_LAUNCH_PACKAGER: "true"
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async function getXcodeBuildArgsAsync(props) {
|
|
118
|
+
const args = [
|
|
119
|
+
props.xcodeProject.isWorkspace ? "-workspace" : "-project",
|
|
120
|
+
props.xcodeProject.name,
|
|
121
|
+
"-configuration",
|
|
122
|
+
props.configuration,
|
|
123
|
+
"-scheme",
|
|
124
|
+
props.scheme,
|
|
125
|
+
"-destination",
|
|
126
|
+
`id=${props.device.udid}`,
|
|
127
|
+
];
|
|
128
|
+
if (!props.isSimulator) {
|
|
129
|
+
const developmentTeamId = await (0, _configureCodeSigning).ensureDeviceIsCodeSignedForDeploymentAsync(props.projectRoot);
|
|
130
|
+
if (developmentTeamId) {
|
|
131
|
+
args.push(`DEVELOPMENT_TEAM=${developmentTeamId}`, "-allowProvisioningUpdates", "-allowProvisioningDeviceRegistration");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Add last
|
|
135
|
+
if (props.buildCache === false) {
|
|
136
|
+
args.push(// Will first clean the derived data folder.
|
|
137
|
+
"clean", // Then build step must be added otherwise the process will simply clean and exit.
|
|
138
|
+
"build");
|
|
139
|
+
}
|
|
140
|
+
return args;
|
|
141
|
+
}
|
|
142
|
+
function spawnXcodeBuild(args, options, { onData }) {
|
|
143
|
+
const buildProcess = (0, _childProcess).spawn("xcodebuild", args, options);
|
|
144
|
+
let results = "";
|
|
145
|
+
let error = "";
|
|
146
|
+
buildProcess.stdout.on("data", (data)=>{
|
|
147
|
+
const stringData = data.toString();
|
|
148
|
+
results += stringData;
|
|
149
|
+
onData(stringData);
|
|
150
|
+
});
|
|
151
|
+
buildProcess.stderr.on("data", (data)=>{
|
|
152
|
+
const stringData = data instanceof Buffer ? data.toString() : data;
|
|
153
|
+
error += stringData;
|
|
154
|
+
});
|
|
155
|
+
return new Promise(async (resolve, reject)=>{
|
|
156
|
+
buildProcess.on("close", (code)=>{
|
|
157
|
+
resolve({
|
|
158
|
+
code,
|
|
159
|
+
results,
|
|
160
|
+
error
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
async function spawnXcodeBuildWithFlush(args, options, { onFlush }) {
|
|
166
|
+
let currentBuffer = "";
|
|
167
|
+
// Data can be sent in chunks that would have no relevance to our regex
|
|
168
|
+
// this can cause massive slowdowns, so we need to ensure the data is complete before attempting to parse it.
|
|
169
|
+
function flushBuffer() {
|
|
170
|
+
if (!currentBuffer) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const data = currentBuffer;
|
|
174
|
+
// Reset buffer.
|
|
175
|
+
currentBuffer = "";
|
|
176
|
+
// Process data.
|
|
177
|
+
onFlush(data);
|
|
178
|
+
}
|
|
179
|
+
const data1 = await spawnXcodeBuild(args, options, {
|
|
180
|
+
onData (stringData) {
|
|
181
|
+
currentBuffer += stringData;
|
|
182
|
+
// Only flush the data if we have a full line.
|
|
183
|
+
if (currentBuffer.endsWith(_os.default.EOL)) {
|
|
184
|
+
flushBuffer();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
// Flush log data at the end just in case we missed something.
|
|
189
|
+
flushBuffer();
|
|
190
|
+
return data1;
|
|
191
|
+
}
|
|
192
|
+
async function spawnXcodeBuildWithFormat(args, options, { projectRoot , xcodeProject }) {
|
|
193
|
+
Log.debug(` xcodebuild ${args.join(" ")}`);
|
|
194
|
+
logPrettyItem(_chalk.default.bold`Planning build`);
|
|
195
|
+
const formatter = _xcpretty.ExpoRunFormatter.create(projectRoot, {
|
|
196
|
+
xcodeProject,
|
|
197
|
+
isDebug: _env.env.EXPO_DEBUG
|
|
198
|
+
});
|
|
199
|
+
const results = await spawnXcodeBuildWithFlush(args, options, {
|
|
200
|
+
onFlush (data) {
|
|
201
|
+
// Process data.
|
|
202
|
+
for (const line of formatter.pipe(data)){
|
|
203
|
+
// Log parsed results.
|
|
204
|
+
Log.log(line);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Log.debug(`Exited with code: ${results.code}`);
|
|
209
|
+
if (// User cancelled with ctrl-c
|
|
210
|
+
results.code === null || // Build interrupted
|
|
211
|
+
results.code === 75) {
|
|
212
|
+
throw new _errors.AbortCommandError();
|
|
213
|
+
}
|
|
214
|
+
Log.log(formatter.getBuildSummary());
|
|
215
|
+
return {
|
|
216
|
+
...results,
|
|
217
|
+
formatter
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async function buildAsync(props) {
|
|
221
|
+
const args = await getXcodeBuildArgsAsync(props);
|
|
222
|
+
const { projectRoot , xcodeProject , shouldSkipInitialBundling , port } = props;
|
|
223
|
+
const { code , results , formatter , error } = await spawnXcodeBuildWithFormat(args, getProcessOptions({
|
|
224
|
+
packager: false,
|
|
225
|
+
terminal: (0, _terminal).getUserTerminal(),
|
|
226
|
+
shouldSkipInitialBundling,
|
|
227
|
+
port
|
|
228
|
+
}), {
|
|
229
|
+
projectRoot,
|
|
230
|
+
xcodeProject
|
|
231
|
+
});
|
|
232
|
+
const logFilePath = writeBuildLogs(projectRoot, results, error);
|
|
233
|
+
if (code !== 0) {
|
|
234
|
+
// Determine if the logger found any errors;
|
|
235
|
+
const wasErrorPresented = !!formatter.errors.length;
|
|
236
|
+
if (wasErrorPresented) {
|
|
237
|
+
// This has a flaw, if the user is missing a file, and there is a script error, only the missing file error will be shown.
|
|
238
|
+
// They will only see the script error if they fix the missing file and rerun.
|
|
239
|
+
// The flaw can be fixed by catching script errors in the custom logger.
|
|
240
|
+
throw new _errors.CommandError(`Failed to build iOS project. "xcodebuild" exited with error code ${code}.`);
|
|
241
|
+
}
|
|
242
|
+
_assertXcodeBuildResults(code, results, error, xcodeProject, logFilePath);
|
|
243
|
+
}
|
|
244
|
+
return results;
|
|
245
|
+
}
|
|
246
|
+
function _assertXcodeBuildResults(code, results, error, xcodeProject, logFilePath) {
|
|
247
|
+
var ref;
|
|
248
|
+
const errorTitle = `Failed to build iOS project. "xcodebuild" exited with error code ${code}.`;
|
|
249
|
+
const throwWithMessage = (message)=>{
|
|
250
|
+
throw new _errors.CommandError(`${errorTitle}\nTo view more error logs, try building the app with Xcode directly, by opening ${xcodeProject.name}.\n\n` + message + `Build logs written to ${_chalk.default.underline(logFilePath)}`);
|
|
251
|
+
};
|
|
252
|
+
const localizedError = (ref = error.match(/NSLocalizedFailure = "(.*)"/)) == null ? void 0 : ref[1];
|
|
253
|
+
if (localizedError) {
|
|
254
|
+
throwWithMessage(_chalk.default.bold(localizedError) + "\n\n");
|
|
255
|
+
}
|
|
256
|
+
// Show all the log info because often times the error is coming from a shell script,
|
|
257
|
+
// that invoked a node script, that started metro, which threw an error.
|
|
258
|
+
throwWithMessage(results + "\n\n" + error);
|
|
259
|
+
}
|
|
260
|
+
function writeBuildLogs(projectRoot, buildOutput, errorOutput) {
|
|
261
|
+
const [logFilePath, errorFilePath] = getErrorLogFilePath(projectRoot);
|
|
262
|
+
_fs.default.writeFileSync(logFilePath, buildOutput);
|
|
263
|
+
_fs.default.writeFileSync(errorFilePath, errorOutput);
|
|
264
|
+
return logFilePath;
|
|
265
|
+
}
|
|
266
|
+
function getErrorLogFilePath(projectRoot) {
|
|
267
|
+
const folder = _path.default.join(projectRoot, ".expo");
|
|
268
|
+
(0, _dir).ensureDirectory(folder);
|
|
269
|
+
return [
|
|
270
|
+
_path.default.join(folder, "xcodebuild.log"),
|
|
271
|
+
_path.default.join(folder, "xcodebuild-error.log")
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
//# sourceMappingURL=XcodeBuild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/ios/XcodeBuild.ts"],"sourcesContent":["import { ExpoRunFormatter } from '@expo/xcpretty';\nimport chalk from 'chalk';\nimport { spawn, SpawnOptionsWithoutStdio } from 'child_process';\nimport fs from 'fs';\nimport os from 'os';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { ensureDirectory } from '../../utils/dir';\nimport { env } from '../../utils/env';\nimport { AbortCommandError, CommandError } from '../../utils/errors';\nimport { getUserTerminal } from '../../utils/terminal';\nimport { BuildProps, ProjectInfo } from './XcodeBuild.types';\nimport { ensureDeviceIsCodeSignedForDeploymentAsync } from './codeSigning/configureCodeSigning';\n\nexport function logPrettyItem(message: string) {\n Log.log(chalk`{whiteBright \\u203A} ${message}`);\n}\n\n/**\n *\n * @returns '/Users/evanbacon/Library/Developer/Xcode/DerivedData/myapp-gpgjqjodrxtervaufttwnsgimhrx/Build/Products/Debug-iphonesimulator/myapp.app'\n */\nexport function getAppBinaryPath(buildOutput: string) {\n // Matches what's used in \"Bundle React Native code and images\" script.\n // Requires that `-hideShellScriptEnvironment` is not included in the build command (extra logs).\n\n // Like `\\=/Users/evanbacon/Library/Developer/Xcode/DerivedData/Exponent-anpuosnglkxokahjhfszejloqfvo/Build/Products/Debug-iphonesimulator`\n const CONFIGURATION_BUILD_DIR = extractEnvVariableFromBuild(\n buildOutput,\n 'CONFIGURATION_BUILD_DIR'\n ).sort(\n // Longer name means more suffixes, we want the shortest possible one to be first.\n // Massive projects (like Expo Go) can sometimes print multiple different sets of environment variables.\n // This can become an issue with some\n (a, b) => a.length - b.length\n );\n // Like `Exponent.app`\n const UNLOCALIZED_RESOURCES_FOLDER_PATH = extractEnvVariableFromBuild(\n buildOutput,\n 'UNLOCALIZED_RESOURCES_FOLDER_PATH'\n );\n\n const binaryPath = path.join(\n // Use the shortest defined env variable (usually there's just one).\n CONFIGURATION_BUILD_DIR[0],\n // Use the last defined env variable.\n UNLOCALIZED_RESOURCES_FOLDER_PATH[UNLOCALIZED_RESOURCES_FOLDER_PATH.length - 1]\n );\n\n // If the app has a space in the name it'll fail because it isn't escaped properly by Xcode.\n return getEscapedPath(binaryPath);\n}\n\nexport function getEscapedPath(filePath: string): string {\n if (fs.existsSync(filePath)) {\n return filePath;\n }\n const unescapedPath = filePath.split(/\\\\ /).join(' ');\n if (fs.existsSync(unescapedPath)) {\n return unescapedPath;\n }\n throw new CommandError(\n 'XCODE_BUILD',\n `Unexpected: Generated app at path \"${filePath}\" cannot be read, the app cannot be installed. Please report this and build onto a simulator.`\n );\n}\n\nexport function extractEnvVariableFromBuild(buildOutput: string, variableName: string) {\n // Xcode can sometimes escape `=` with a backslash or put the value in quotes\n const reg = new RegExp(`export ${variableName}\\\\\\\\?=(.*)$`, 'mg');\n const matched = [...buildOutput.matchAll(reg)];\n\n if (!matched || !matched.length) {\n throw new CommandError(\n 'XCODE_BUILD',\n `Malformed xcodebuild results: \"${variableName}\" variable was not generated in build output. Please report this issue and run your project with Xcode instead.`\n );\n }\n return matched.map((value) => value[1]).filter(Boolean) as string[];\n}\n\nexport function getProcessOptions({\n packager,\n shouldSkipInitialBundling,\n terminal,\n port,\n}: {\n packager: boolean;\n shouldSkipInitialBundling?: boolean;\n terminal: string | undefined;\n port: number;\n}): SpawnOptionsWithoutStdio {\n const SKIP_BUNDLING = shouldSkipInitialBundling ? '1' : undefined;\n if (packager) {\n return {\n env: {\n ...process.env,\n RCT_TERMINAL: terminal,\n SKIP_BUNDLING,\n RCT_METRO_PORT: port.toString(),\n },\n };\n }\n\n return {\n env: {\n ...process.env,\n RCT_TERMINAL: terminal,\n SKIP_BUNDLING,\n // Always skip launching the packager from a build script.\n // The script is used for people building their project directly from Xcode.\n // This essentially means \"› Running script 'Start Packager'\" does nothing.\n RCT_NO_LAUNCH_PACKAGER: 'true',\n // FORCE_BUNDLING: '0'\n },\n };\n}\n\nexport async function getXcodeBuildArgsAsync(\n props: Pick<\n BuildProps,\n | 'buildCache'\n | 'projectRoot'\n | 'xcodeProject'\n | 'configuration'\n | 'scheme'\n | 'device'\n | 'isSimulator'\n >\n): Promise<string[]> {\n const args = [\n props.xcodeProject.isWorkspace ? '-workspace' : '-project',\n props.xcodeProject.name,\n '-configuration',\n props.configuration,\n '-scheme',\n props.scheme,\n '-destination',\n `id=${props.device.udid}`,\n ];\n\n if (!props.isSimulator) {\n const developmentTeamId = await ensureDeviceIsCodeSignedForDeploymentAsync(props.projectRoot);\n if (developmentTeamId) {\n args.push(\n `DEVELOPMENT_TEAM=${developmentTeamId}`,\n '-allowProvisioningUpdates',\n '-allowProvisioningDeviceRegistration'\n );\n }\n }\n\n // Add last\n if (props.buildCache === false) {\n args.push(\n // Will first clean the derived data folder.\n 'clean',\n // Then build step must be added otherwise the process will simply clean and exit.\n 'build'\n );\n }\n return args;\n}\n\nfunction spawnXcodeBuild(\n args: string[],\n options: SpawnOptionsWithoutStdio,\n { onData }: { onData: (data: string) => void }\n): Promise<{ code: number | null; results: string; error: string }> {\n const buildProcess = spawn('xcodebuild', args, options);\n\n let results = '';\n let error = '';\n\n buildProcess.stdout.on('data', (data: Buffer) => {\n const stringData = data.toString();\n results += stringData;\n onData(stringData);\n });\n\n buildProcess.stderr.on('data', (data: Buffer) => {\n const stringData = data instanceof Buffer ? data.toString() : data;\n error += stringData;\n });\n\n return new Promise(async (resolve, reject) => {\n buildProcess.on('close', (code: number) => {\n resolve({ code, results, error });\n });\n });\n}\n\nasync function spawnXcodeBuildWithFlush(\n args: string[],\n options: SpawnOptionsWithoutStdio,\n { onFlush }: { onFlush: (data: string) => void }\n): Promise<{ code: number | null; results: string; error: string }> {\n let currentBuffer = '';\n\n // Data can be sent in chunks that would have no relevance to our regex\n // this can cause massive slowdowns, so we need to ensure the data is complete before attempting to parse it.\n function flushBuffer() {\n if (!currentBuffer) {\n return;\n }\n\n const data = currentBuffer;\n // Reset buffer.\n currentBuffer = '';\n // Process data.\n onFlush(data);\n }\n\n const data = await spawnXcodeBuild(args, options, {\n onData(stringData) {\n currentBuffer += stringData;\n // Only flush the data if we have a full line.\n if (currentBuffer.endsWith(os.EOL)) {\n flushBuffer();\n }\n },\n });\n\n // Flush log data at the end just in case we missed something.\n flushBuffer();\n return data;\n}\n\nasync function spawnXcodeBuildWithFormat(\n args: string[],\n options: SpawnOptionsWithoutStdio,\n { projectRoot, xcodeProject }: { projectRoot: string; xcodeProject: ProjectInfo }\n): Promise<{ code: number | null; results: string; error: string; formatter: ExpoRunFormatter }> {\n Log.debug(` xcodebuild ${args.join(' ')}`);\n\n logPrettyItem(chalk.bold`Planning build`);\n\n const formatter = ExpoRunFormatter.create(projectRoot, {\n xcodeProject,\n isDebug: env.EXPO_DEBUG,\n });\n\n const results = await spawnXcodeBuildWithFlush(args, options, {\n onFlush(data) {\n // Process data.\n for (const line of formatter.pipe(data)) {\n // Log parsed results.\n Log.log(line);\n }\n },\n });\n\n Log.debug(`Exited with code: ${results.code}`);\n\n if (\n // User cancelled with ctrl-c\n results.code === null ||\n // Build interrupted\n results.code === 75\n ) {\n throw new AbortCommandError();\n }\n\n Log.log(formatter.getBuildSummary());\n\n return { ...results, formatter };\n}\n\nexport async function buildAsync(props: BuildProps): Promise<string> {\n const args = await getXcodeBuildArgsAsync(props);\n\n const { projectRoot, xcodeProject, shouldSkipInitialBundling, port } = props;\n\n const { code, results, formatter, error } = await spawnXcodeBuildWithFormat(\n args,\n getProcessOptions({\n packager: false,\n terminal: getUserTerminal(),\n shouldSkipInitialBundling,\n port,\n }),\n {\n projectRoot,\n xcodeProject,\n }\n );\n\n const logFilePath = writeBuildLogs(projectRoot, results, error);\n\n if (code !== 0) {\n // Determine if the logger found any errors;\n const wasErrorPresented = !!formatter.errors.length;\n\n if (wasErrorPresented) {\n // This has a flaw, if the user is missing a file, and there is a script error, only the missing file error will be shown.\n // They will only see the script error if they fix the missing file and rerun.\n // The flaw can be fixed by catching script errors in the custom logger.\n throw new CommandError(\n `Failed to build iOS project. \"xcodebuild\" exited with error code ${code}.`\n );\n }\n\n _assertXcodeBuildResults(code, results, error, xcodeProject, logFilePath);\n }\n return results;\n}\n\n// Exposed for testing.\nexport function _assertXcodeBuildResults(\n code: number | null,\n results: string,\n error: string,\n xcodeProject: { name: string },\n logFilePath: string\n): void {\n const errorTitle = `Failed to build iOS project. \"xcodebuild\" exited with error code ${code}.`;\n\n const throwWithMessage = (message: string): never => {\n throw new CommandError(\n `${errorTitle}\\nTo view more error logs, try building the app with Xcode directly, by opening ${xcodeProject.name}.\\n\\n` +\n message +\n `Build logs written to ${chalk.underline(logFilePath)}`\n );\n };\n\n const localizedError = error.match(/NSLocalizedFailure = \"(.*)\"/)?.[1];\n\n if (localizedError) {\n throwWithMessage(chalk.bold(localizedError) + '\\n\\n');\n }\n // Show all the log info because often times the error is coming from a shell script,\n // that invoked a node script, that started metro, which threw an error.\n\n throwWithMessage(results + '\\n\\n' + error);\n}\n\nfunction writeBuildLogs(projectRoot: string, buildOutput: string, errorOutput: string) {\n const [logFilePath, errorFilePath] = getErrorLogFilePath(projectRoot);\n\n fs.writeFileSync(logFilePath, buildOutput);\n fs.writeFileSync(errorFilePath, errorOutput);\n return logFilePath;\n}\n\nfunction getErrorLogFilePath(projectRoot: string): [string, string] {\n const folder = path.join(projectRoot, '.expo');\n ensureDirectory(folder);\n return [path.join(folder, 'xcodebuild.log'), path.join(folder, 'xcodebuild-error.log')];\n}\n"],"names":["logPrettyItem","getAppBinaryPath","getEscapedPath","extractEnvVariableFromBuild","getProcessOptions","getXcodeBuildArgsAsync","buildAsync","_assertXcodeBuildResults","Log","message","log","chalk","buildOutput","CONFIGURATION_BUILD_DIR","sort","a","b","length","UNLOCALIZED_RESOURCES_FOLDER_PATH","binaryPath","path","join","filePath","fs","existsSync","unescapedPath","split","CommandError","variableName","reg","RegExp","matched","matchAll","map","value","filter","Boolean","packager","shouldSkipInitialBundling","terminal","port","SKIP_BUNDLING","undefined","env","process","RCT_TERMINAL","RCT_METRO_PORT","toString","RCT_NO_LAUNCH_PACKAGER","props","args","xcodeProject","isWorkspace","name","configuration","scheme","device","udid","isSimulator","developmentTeamId","ensureDeviceIsCodeSignedForDeploymentAsync","projectRoot","push","buildCache","spawnXcodeBuild","options","onData","buildProcess","spawn","results","error","stdout","on","data","stringData","stderr","Buffer","Promise","resolve","reject","code","spawnXcodeBuildWithFlush","onFlush","currentBuffer","flushBuffer","endsWith","os","EOL","spawnXcodeBuildWithFormat","debug","bold","formatter","ExpoRunFormatter","create","isDebug","EXPO_DEBUG","line","pipe","AbortCommandError","getBuildSummary","getUserTerminal","logFilePath","writeBuildLogs","wasErrorPresented","errors","errorTitle","throwWithMessage","underline","localizedError","match","errorOutput","errorFilePath","getErrorLogFilePath","writeFileSync","folder","ensureDirectory"],"mappings":"AAAA;;;;QAegBA,aAAa,GAAbA,aAAa;QAQbC,gBAAgB,GAAhBA,gBAAgB;QA+BhBC,cAAc,GAAdA,cAAc;QAcdC,2BAA2B,GAA3BA,2BAA2B;QAc3BC,iBAAiB,GAAjBA,iBAAiB;QAqCXC,sBAAsB,GAAtBA,sBAAsB;QAsJtBC,UAAU,GAAVA,UAAU;QAwChBC,wBAAwB,GAAxBA,wBAAwB;AArTP,IAAA,SAAgB,WAAhB,gBAAgB,CAAA;AAC/B,IAAA,MAAO,kCAAP,OAAO,EAAA;AACuB,IAAA,aAAe,WAAf,eAAe,CAAA;AAChD,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACJ,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACiB,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AAC7B,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACW,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AACpC,IAAA,SAAsB,WAAtB,sB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D,MAAM,CAAC,CAAC;IACxB,OAAO;QAAC9F,KAAI,QAAA,CAACC,IAAI,CAAC6F,MAAM,EAAE,gBAAgB,CAAC;QAAE9F,KAAI,QAAA,CAACC,IAAI,CAAC6F,MAAM,EAAE,sBAAsB,CAAC;KAAC,CAAC;CACzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/ios/XcodeBuild.types.ts"],"sourcesContent":["import { BundlerProps } from '../resolveBundlerProps';\n\nexport type XcodeConfiguration = 'Debug' | 'Release';\n\nexport type Options = {\n /** iOS device to target. */\n device?: string | boolean;\n /** Dev server port to use, ignored if `bundler` is `false`. */\n port?: number;\n /** Xcode scheme to build. */\n scheme?: string | boolean;\n /** Xcode configuration to build. Default `Debug` */\n configuration?: XcodeConfiguration;\n /** Should start the bundler dev server. */\n bundler?: boolean;\n /** Should install missing dependencies before building. */\n install?: boolean;\n /** Should use derived data for builds. */\n buildCache?: boolean;\n};\n\nexport type ProjectInfo = {\n isWorkspace: boolean;\n name: string;\n};\n\nexport type BuildProps = {\n /** Root to the iOS native project. */\n projectRoot: string;\n /** Is the target a simulator. */\n isSimulator: boolean;\n xcodeProject: ProjectInfo;\n device: { name: string; udid: string };\n configuration: XcodeConfiguration;\n /** Disable the initial bundling from the native script. */\n shouldSkipInitialBundling: boolean;\n /** Should use derived data for builds. */\n buildCache: boolean;\n scheme: string;\n} & BundlerProps;\n"],"names":[],"mappings":"AAAA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.getConnectedDevicesAsync = getConnectedDevicesAsync;
|
|
6
|
+
exports.getConnectedDeviceValuesAsync = getConnectedDeviceValuesAsync;
|
|
7
|
+
exports.runOnDevice = runOnDevice;
|
|
8
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
9
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
10
|
+
var _path = _interopRequireDefault(require("path"));
|
|
11
|
+
var _xcodeDeveloperDiskImagePrerequisite = require("../../../start/doctor/apple/XcodeDeveloperDiskImagePrerequisite");
|
|
12
|
+
var _delay = require("../../../utils/delay");
|
|
13
|
+
var _errors = require("../../../utils/errors");
|
|
14
|
+
var _exit = require("../../../utils/exit");
|
|
15
|
+
var _clientManager = require("./ClientManager");
|
|
16
|
+
var _lockdowndClient = require("./client/LockdowndClient");
|
|
17
|
+
var _usbmuxdClient = require("./client/UsbmuxdClient");
|
|
18
|
+
var _afcprotocol = require("./protocol/AFCProtocol");
|
|
19
|
+
function _interopRequireDefault(obj) {
|
|
20
|
+
return obj && obj.__esModule ? obj : {
|
|
21
|
+
default: obj
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const debug = (0, _debug).default("expo:apple-device");
|
|
25
|
+
async function getConnectedDevicesAsync() {
|
|
26
|
+
const results = await getConnectedDeviceValuesAsync();
|
|
27
|
+
var _DeviceName, ref;
|
|
28
|
+
// TODO: Add support for osType (ipad, watchos, etc)
|
|
29
|
+
return results.map((device)=>({
|
|
30
|
+
// TODO: Better name
|
|
31
|
+
name: (ref = (_DeviceName = device.DeviceName) != null ? _DeviceName : device.ProductType) != null ? ref : "unknown ios device",
|
|
32
|
+
model: device.ProductType,
|
|
33
|
+
osVersion: device.ProductVersion,
|
|
34
|
+
deviceType: "device",
|
|
35
|
+
udid: device.UniqueDeviceID
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
async function getConnectedDeviceValuesAsync() {
|
|
40
|
+
const client = new _usbmuxdClient.UsbmuxdClient(_usbmuxdClient.UsbmuxdClient.connectUsbmuxdSocket());
|
|
41
|
+
const devices = await client.getDevices();
|
|
42
|
+
client.socket.end();
|
|
43
|
+
return Promise.all(devices.map(async (device)=>{
|
|
44
|
+
const socket = await new _usbmuxdClient.UsbmuxdClient(_usbmuxdClient.UsbmuxdClient.connectUsbmuxdSocket()).connect(device, 62078);
|
|
45
|
+
const deviceValue = await new _lockdowndClient.LockdowndClient(socket).getAllValues();
|
|
46
|
+
socket.end();
|
|
47
|
+
return deviceValue;
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
async function runOnDevice({ udid , appPath , bundleId , waitForApp , deltaPath , onProgress }) {
|
|
51
|
+
const clientManager = await _clientManager.ClientManager.create(udid);
|
|
52
|
+
try {
|
|
53
|
+
await mountDeveloperDiskImage(clientManager);
|
|
54
|
+
const packageName = _path.default.basename(appPath);
|
|
55
|
+
const destPackagePath = _path.default.join("PublicStaging", packageName);
|
|
56
|
+
await uploadApp(clientManager, {
|
|
57
|
+
appBinaryPath: appPath,
|
|
58
|
+
destinationPath: destPackagePath
|
|
59
|
+
});
|
|
60
|
+
const installer = await clientManager.getInstallationProxyClient();
|
|
61
|
+
await installer.installApp(destPackagePath, bundleId, {
|
|
62
|
+
// https://github.com/ios-control/ios-deploy/blob/0f2ffb1e564aa67a2dfca7cdf13de47ce489d835/src/ios-deploy/ios-deploy.m#L2491-L2508
|
|
63
|
+
ApplicationsType: "Any",
|
|
64
|
+
CFBundleIdentifier: bundleId,
|
|
65
|
+
CloseOnInvalidate: "1",
|
|
66
|
+
InvalidateOnDetach: "1",
|
|
67
|
+
IsUserInitiated: "1",
|
|
68
|
+
// Disable checking for wifi devices, this is nominally faster.
|
|
69
|
+
PreferWifi: "0",
|
|
70
|
+
// Only info I could find on these:
|
|
71
|
+
// https://github.com/wwxxyx/Quectel_BG96/blob/310876f90fc1093a59e45e381160eddcc31697d0/Apple_Homekit/homekit_certification_tools/ATS%206/ATS%206/ATS.app/Contents/Frameworks/CaptureKit.framework/Versions/A/Resources/MobileDevice/MobileInstallation.h#L112-L121
|
|
72
|
+
PackageType: "Developer",
|
|
73
|
+
ShadowParentKey: deltaPath
|
|
74
|
+
}, onProgress);
|
|
75
|
+
const { [bundleId]: appInfo } = await installer.lookupApp([
|
|
76
|
+
bundleId
|
|
77
|
+
]);
|
|
78
|
+
// launch fails with EBusy or ENotFound if you try to launch immediately after install
|
|
79
|
+
await (0, _delay).delayAsync(200);
|
|
80
|
+
const debugServerClient = await launchApp(clientManager, {
|
|
81
|
+
appInfo,
|
|
82
|
+
detach: !waitForApp
|
|
83
|
+
});
|
|
84
|
+
if (waitForApp) {
|
|
85
|
+
(0, _exit).installExitHooks(async ()=>{
|
|
86
|
+
// causes continue() to return
|
|
87
|
+
debugServerClient.halt();
|
|
88
|
+
// give continue() time to return response
|
|
89
|
+
await (0, _delay).delayAsync(64);
|
|
90
|
+
});
|
|
91
|
+
debug(`Waiting for app to close...\n`);
|
|
92
|
+
const result = await debugServerClient.continue();
|
|
93
|
+
// TODO: I have no idea what this packet means yet (successful close?)
|
|
94
|
+
// if not a close (ie, most likely due to halt from onBeforeExit), then kill the app
|
|
95
|
+
if (result !== "W00") {
|
|
96
|
+
await debugServerClient.kill();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} finally{
|
|
100
|
+
clientManager.end();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Mount the developer disk image for Xcode. */ async function mountDeveloperDiskImage(clientManager) {
|
|
104
|
+
const imageMounter = await clientManager.getMobileImageMounterClient();
|
|
105
|
+
// Check if already mounted. If not, mount.
|
|
106
|
+
if (!(await imageMounter.lookupImage()).ImageSignature) {
|
|
107
|
+
// verify DeveloperDiskImage exists (TODO: how does this work on Windows/Linux?)
|
|
108
|
+
// TODO: if windows/linux, download?
|
|
109
|
+
const version = await (await clientManager.getLockdowndClient()).getValue("ProductVersion");
|
|
110
|
+
const developerDiskImagePath = await _xcodeDeveloperDiskImagePrerequisite.XcodeDeveloperDiskImagePrerequisite.instance.assertAsync({
|
|
111
|
+
version
|
|
112
|
+
});
|
|
113
|
+
const developerDiskImageSig = _fs.default.readFileSync(`${developerDiskImagePath}.signature`);
|
|
114
|
+
await imageMounter.uploadImage(developerDiskImagePath, developerDiskImageSig);
|
|
115
|
+
await imageMounter.mountImage(developerDiskImagePath, developerDiskImageSig);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async function uploadApp(clientManager, { appBinaryPath , destinationPath }) {
|
|
119
|
+
const afcClient = await clientManager.getAFCClient();
|
|
120
|
+
try {
|
|
121
|
+
await afcClient.getFileInfo("PublicStaging");
|
|
122
|
+
} catch (err) {
|
|
123
|
+
if (err instanceof _afcprotocol.AFCError && err.status === _afcprotocol.AFC_STATUS.OBJECT_NOT_FOUND) {
|
|
124
|
+
await afcClient.makeDirectory("PublicStaging");
|
|
125
|
+
} else {
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
await afcClient.uploadDirectory(appBinaryPath, destinationPath);
|
|
130
|
+
}
|
|
131
|
+
async function launchApp(clientManager, { appInfo , detach }) {
|
|
132
|
+
let tries = 0;
|
|
133
|
+
while(tries < 3){
|
|
134
|
+
const debugServerClient = await clientManager.getDebugserverClient();
|
|
135
|
+
await debugServerClient.setMaxPacketSize(1024);
|
|
136
|
+
await debugServerClient.setWorkingDir(appInfo.Container);
|
|
137
|
+
await debugServerClient.launchApp(appInfo.Path, appInfo.CFBundleExecutable);
|
|
138
|
+
const result = await debugServerClient.checkLaunchSuccess();
|
|
139
|
+
if (result === "OK") {
|
|
140
|
+
if (detach) {
|
|
141
|
+
// https://github.com/libimobiledevice/libimobiledevice/blob/25059d4c7d75e03aab516af2929d7c6e6d4c17de/tools/idevicedebug.c#L455-L464
|
|
142
|
+
const res = await debugServerClient.sendCommand("D", []);
|
|
143
|
+
debug("Disconnect from debug server request:", res);
|
|
144
|
+
if (res !== "OK") {
|
|
145
|
+
console.warn("Something went wrong while attempting to disconnect from iOS debug server, you may need to reopen the app manually.");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return debugServerClient;
|
|
149
|
+
} else if (result === "EBusy" || result === "ENotFound") {
|
|
150
|
+
debug("Device busy or app not found, trying to launch again in .5s...");
|
|
151
|
+
tries++;
|
|
152
|
+
debugServerClient.socket.end();
|
|
153
|
+
await (0, _delay).delayAsync(500);
|
|
154
|
+
} else {
|
|
155
|
+
throw new _errors.CommandError(`There was an error launching app: ${result}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
throw new _errors.CommandError("Unable to launch app, number of tries exceeded");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=AppleDevice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/run/ios/appleDevice/AppleDevice.ts"],"sourcesContent":["import Debug from 'debug';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { XcodeDeveloperDiskImagePrerequisite } from '../../../start/doctor/apple/XcodeDeveloperDiskImagePrerequisite';\nimport { delayAsync } from '../../../utils/delay';\nimport { CommandError } from '../../../utils/errors';\nimport { installExitHooks } from '../../../utils/exit';\nimport { ClientManager } from './ClientManager';\nimport { IPLookupResult, OnInstallProgressCallback } from './client/InstallationProxyClient';\nimport { DeviceValues, LockdowndClient } from './client/LockdowndClient';\nimport { UsbmuxdClient } from './client/UsbmuxdClient';\nimport { AFC_STATUS, AFCError } from './protocol/AFCProtocol';\n\nconst debug = Debug('expo:apple-device');\n\n// NOTE(EvanBacon): I have a feeling this shape will change with new iOS versions (tested against iOS 15).\nexport interface ConnectedDevice {\n /** @example `00008101-001964A22629003A` */\n udid: string;\n /** @example `Evan's phone` */\n name: string;\n /** @example `iPhone13,4` */\n model: string;\n /** @example `device` */\n deviceType: 'device' | 'catalyst';\n /** @example `15.4.1` */\n osVersion: string;\n}\n\nexport async function getConnectedDevicesAsync(): Promise<ConnectedDevice[]> {\n const results = await getConnectedDeviceValuesAsync();\n // TODO: Add support for osType (ipad, watchos, etc)\n return results.map((device) => ({\n // TODO: Better name\n name: device.DeviceName ?? device.ProductType ?? 'unknown ios device',\n model: device.ProductType,\n osVersion: device.ProductVersion,\n deviceType: 'device',\n udid: device.UniqueDeviceID,\n }));\n}\n\n/** @returns a list of physically connected Apple devices. */\nexport async function getConnectedDeviceValuesAsync(): Promise<DeviceValues[]> {\n const client = new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket());\n const devices = await client.getDevices();\n client.socket.end();\n\n return Promise.all(\n devices.map(async (device): Promise<DeviceValues> => {\n const socket = await new UsbmuxdClient(UsbmuxdClient.connectUsbmuxdSocket()).connect(\n device,\n 62078\n );\n const deviceValue = await new LockdowndClient(socket).getAllValues();\n socket.end();\n return deviceValue;\n })\n );\n}\n\n/** Install and run an Apple app binary on a connected Apple device. */\nexport async function runOnDevice({\n udid,\n appPath,\n bundleId,\n waitForApp,\n deltaPath,\n onProgress,\n}: {\n /** Apple device UDID */\n udid: string;\n /** File path to the app binary (ipa) */\n appPath: string;\n /** Bundle identifier for the app at `appPath` */\n bundleId: string;\n /** Wait for the app to launch before returning */\n waitForApp: boolean;\n /** File path to the app deltas folder to use for faster subsequent installs */\n deltaPath: string;\n /** Callback to be called with progress updates */\n onProgress: OnInstallProgressCallback;\n}) {\n const clientManager = await ClientManager.create(udid);\n\n try {\n await mountDeveloperDiskImage(clientManager);\n\n const packageName = path.basename(appPath);\n const destPackagePath = path.join('PublicStaging', packageName);\n\n await uploadApp(clientManager, { appBinaryPath: appPath, destinationPath: destPackagePath });\n\n const installer = await clientManager.getInstallationProxyClient();\n await installer.installApp(\n destPackagePath,\n bundleId,\n {\n // https://github.com/ios-control/ios-deploy/blob/0f2ffb1e564aa67a2dfca7cdf13de47ce489d835/src/ios-deploy/ios-deploy.m#L2491-L2508\n ApplicationsType: 'Any',\n\n CFBundleIdentifier: bundleId,\n CloseOnInvalidate: '1',\n InvalidateOnDetach: '1',\n IsUserInitiated: '1',\n // Disable checking for wifi devices, this is nominally faster.\n PreferWifi: '0',\n // Only info I could find on these:\n // https://github.com/wwxxyx/Quectel_BG96/blob/310876f90fc1093a59e45e381160eddcc31697d0/Apple_Homekit/homekit_certification_tools/ATS%206/ATS%206/ATS.app/Contents/Frameworks/CaptureKit.framework/Versions/A/Resources/MobileDevice/MobileInstallation.h#L112-L121\n PackageType: 'Developer',\n ShadowParentKey: deltaPath,\n // SkipUninstall: '1'\n },\n onProgress\n );\n\n const { [bundleId]: appInfo } = await installer.lookupApp([bundleId]);\n // launch fails with EBusy or ENotFound if you try to launch immediately after install\n await delayAsync(200);\n const debugServerClient = await launchApp(clientManager, { appInfo, detach: !waitForApp });\n if (waitForApp) {\n installExitHooks(async () => {\n // causes continue() to return\n debugServerClient.halt();\n // give continue() time to return response\n await delayAsync(64);\n });\n\n debug(`Waiting for app to close...\\n`);\n const result = await debugServerClient.continue();\n // TODO: I have no idea what this packet means yet (successful close?)\n // if not a close (ie, most likely due to halt from onBeforeExit), then kill the app\n if (result !== 'W00') {\n await debugServerClient.kill();\n }\n }\n } finally {\n clientManager.end();\n }\n}\n\n/** Mount the developer disk image for Xcode. */\nasync function mountDeveloperDiskImage(clientManager: ClientManager) {\n const imageMounter = await clientManager.getMobileImageMounterClient();\n // Check if already mounted. If not, mount.\n if (!(await imageMounter.lookupImage()).ImageSignature) {\n // verify DeveloperDiskImage exists (TODO: how does this work on Windows/Linux?)\n // TODO: if windows/linux, download?\n const version = await (await clientManager.getLockdowndClient()).getValue('ProductVersion');\n const developerDiskImagePath = await XcodeDeveloperDiskImagePrerequisite.instance.assertAsync({\n version,\n });\n const developerDiskImageSig = fs.readFileSync(`${developerDiskImagePath}.signature`);\n await imageMounter.uploadImage(developerDiskImagePath, developerDiskImageSig);\n await imageMounter.mountImage(developerDiskImagePath, developerDiskImageSig);\n }\n}\n\nasync function uploadApp(\n clientManager: ClientManager,\n { appBinaryPath, destinationPath }: { appBinaryPath: string; destinationPath: string }\n) {\n const afcClient = await clientManager.getAFCClient();\n try {\n await afcClient.getFileInfo('PublicStaging');\n } catch (err: any) {\n if (err instanceof AFCError && err.status === AFC_STATUS.OBJECT_NOT_FOUND) {\n await afcClient.makeDirectory('PublicStaging');\n } else {\n throw err;\n }\n }\n await afcClient.uploadDirectory(appBinaryPath, destinationPath);\n}\n\nasync function launchApp(\n clientManager: ClientManager,\n { appInfo, detach }: { appInfo: IPLookupResult[string]; detach?: boolean }\n) {\n let tries = 0;\n while (tries < 3) {\n const debugServerClient = await clientManager.getDebugserverClient();\n await debugServerClient.setMaxPacketSize(1024);\n await debugServerClient.setWorkingDir(appInfo.Container);\n await debugServerClient.launchApp(appInfo.Path, appInfo.CFBundleExecutable);\n\n const result = await debugServerClient.checkLaunchSuccess();\n if (result === 'OK') {\n if (detach) {\n // https://github.com/libimobiledevice/libimobiledevice/blob/25059d4c7d75e03aab516af2929d7c6e6d4c17de/tools/idevicedebug.c#L455-L464\n const res = await debugServerClient.sendCommand('D', []);\n debug('Disconnect from debug server request:', res);\n if (res !== 'OK') {\n console.warn(\n 'Something went wrong while attempting to disconnect from iOS debug server, you may need to reopen the app manually.'\n );\n }\n }\n\n return debugServerClient;\n } else if (result === 'EBusy' || result === 'ENotFound') {\n debug('Device busy or app not found, trying to launch again in .5s...');\n tries++;\n debugServerClient.socket.end();\n await delayAsync(500);\n } else {\n throw new CommandError(`There was an error launching app: ${result}`);\n }\n }\n throw new CommandError('Unable to launch app, number of tries exceeded');\n}\n"],"names":["getConnectedDevicesAsync","getConnectedDeviceValuesAsync","runOnDevice","debug","Debug","results","device","map","name","DeviceName","ProductType","model","osVersion","ProductVersion","deviceType","udid","UniqueDeviceID","client","UsbmuxdClient","connectUsbmuxdSocket","devices","getDevices","socket","end","Promise","all","connect","deviceValue","LockdowndClient","getAllValues","appPath","bundleId","waitForApp","deltaPath","onProgress","clientManager","ClientManager","create","mountDeveloperDiskImage","packageName","path","basename","destPackagePath","join","uploadApp","appBinaryPath","destinationPath","installer","getInstallationProxyClient","installApp","ApplicationsType","CFBundleIdentifier","CloseOnInvalidate","InvalidateOnDetach","IsUserInitiated","PreferWifi","PackageType","ShadowParentKey","appInfo","lookupApp","delayAsync","debugServerClient","launchApp","detach","installExitHooks","halt","result","continue","kill","imageMounter","getMobileImageMounterClient","lookupImage","ImageSignature","version","getLockdowndClient","getValue","developerDiskImagePath","XcodeDeveloperDiskImagePrerequisite","instance","assertAsync","developerDiskImageSig","fs","readFileSync","uploadImage","mountImage","afcClient","getAFCClient","getFileInfo","err","AFCError","status","AFC_STATUS","OBJECT_NOT_FOUND","makeDirectory","uploadDirectory","tries","getDebugserverClient","setMaxPacketSize","setWorkingDir","Container","Path","CFBundleExecutable","checkLaunchSuccess","res","sendCommand","console","warn","CommandError"],"mappings":"AAAA;;;;QA8BsBA,wBAAwB,GAAxBA,wBAAwB;QAcxBC,6BAA6B,GAA7BA,6BAA6B;QAmB7BC,WAAW,GAAXA,WAAW;AA/Df,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAE6B,IAAA,oCAAiE,WAAjE,iEAAiE,CAAA;AAC1F,IAAA,MAAsB,WAAtB,sBAAsB,CAAA;AACpB,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACnB,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACxB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AAED,IAAA,gBAA0B,WAA1B,0BAA0B,CAAA;AAC1C,IAAA,cAAwB,WAAxB,wBAAwB,CAAA;AACjB,IAAA,YAAwB,WAAxB,wBAAwB,CAAA;;;;;;AAE7D,MAAMC,KAAK,GAAGC,CAAAA,GAAAA,MAAK,AAAqB,CAAA,QAArB,CAAC,mBAAmB,CAAC,AAAC;AAgBlC,eAAeJ,wBAAwB,GAA+B;IAC3E,MAAMK,OAAO,GAAG,MAAMJ,6BAA6B,EAAE,AAAC;QAI9CK,WAAiB,EAAjBA,GAAuC;IAH/C,oDAAoD;IACpD,OAAOD,OAAO,CAACE,GAAG,CAAC,CAACD,MAAM,GAAK,CAAC;YAC9B,oBAAoB;YACpBE,IAAI,EAAEF,CAAAA,GAAuC,GAAvCA,CAAAA,WAAiB,GAAjBA,MAAM,CAACG,UAAU,YAAjBH,WA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