nativescript 8.7.0 → 8.8.0-alpha.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/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- package/lib/commands/add-platform.js +0 -1
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +0 -4
- package/lib/commands/build.js +2 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -3
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +1 -6
- package/lib/commands/deploy.js +2 -3
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +2 -12
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +2 -3
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +2 -9
- package/lib/commands/typings.js +76 -4
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +2 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +1 -20
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +3 -91
- package/lib/controllers/platform-controller.js +1 -9
- package/lib/controllers/prepare-controller.js +4 -14
- package/lib/controllers/run-controller.js +1 -17
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +0 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +0 -1
- package/lib/data/run-data.js +0 -1
- package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +2 -7
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +2 -3
- package/lib/key-commands/index.js +4 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -10
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +116 -141
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +0 -1
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +2 -9
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +12 -43
- package/lib/services/android-project-service.js +4 -71
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
- package/lib/services/assets-generation/assets-generation-service.js +5 -16
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/cleanup-service.js +9 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +0 -1
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +1 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +0 -4
- package/lib/services/ios/spm-service.js +0 -9
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- package/lib/services/ios/xcodebuild-service.js +0 -1
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +4 -6
- package/lib/services/ios-project-service.js +1 -23
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
- package/lib/services/livesync/android-livesync-service.js +0 -1
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +0 -2
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +0 -5
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +0 -15
- package/lib/services/marking-mode-service.js +5 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +1 -3
- package/lib/services/platform/add-platform-service.js +2 -47
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -5
- package/lib/services/platform-environment-requirements.js +3 -8
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +2 -18
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +3 -12
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +1 -18
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -1
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +2 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/webpack/webpack-compiler-service.js +1 -42
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +0 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- package/package.json +1 -1
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +21 -15
|
@@ -36,7 +36,6 @@ class DeviceLogProvider extends device_log_provider_base_1.DeviceLogProviderBase
|
|
|
36
36
|
this.colorPoolIndex = 0;
|
|
37
37
|
}
|
|
38
38
|
logData(lineText, platform, deviceIdentifier) {
|
|
39
|
-
// console.log(lineText)
|
|
40
39
|
const loggingOptions = this.getDeviceLogOptionsForDevice(deviceIdentifier);
|
|
41
40
|
let data = this.$logFilter.filterData(platform, lineText, loggingOptions);
|
|
42
41
|
data = this.$logSourceMapService.replaceWithOriginalFileLocations(platform, data, loggingOptions);
|
|
@@ -54,7 +53,6 @@ class DeviceLogProvider extends device_log_provider_base_1.DeviceLogProviderBase
|
|
|
54
53
|
return this.deviceColorMap.get(deviceIdentifier);
|
|
55
54
|
}
|
|
56
55
|
const color = this.colorPool[this.colorPoolIndex];
|
|
57
|
-
// wrap around if we have no more colors in the pool
|
|
58
56
|
this.colorPoolIndex =
|
|
59
57
|
this.colorPoolIndex === this.colorPool.length - 1
|
|
60
58
|
? 0
|
|
@@ -64,13 +62,10 @@ class DeviceLogProvider extends device_log_provider_base_1.DeviceLogProviderBase
|
|
|
64
62
|
}
|
|
65
63
|
logDataCore(data, deviceIdentifier) {
|
|
66
64
|
var _a, _b, _c;
|
|
67
|
-
// todo: use config to set logger - --env.classicLogs is temporary!
|
|
68
65
|
if ("classicLogs" in ((_a = this.$options.env) !== null && _a !== void 0 ? _a : {})) {
|
|
69
|
-
// legacy logging
|
|
70
66
|
this.$logger.info(data, { [constants_2.LoggerConfigData.skipNewLine]: true });
|
|
71
67
|
return;
|
|
72
68
|
}
|
|
73
|
-
// todo: extract into an injectable printer/logger service
|
|
74
69
|
let shouldPrepend = false;
|
|
75
70
|
let splitIndexes = [];
|
|
76
71
|
const lines = data
|
|
@@ -125,25 +120,7 @@ class DeviceLogProvider extends device_log_provider_base_1.DeviceLogProviderBase
|
|
|
125
120
|
printLine(prefix, ...parts) {
|
|
126
121
|
const fullLine = parts.join(" ");
|
|
127
122
|
console.log(prefix, fullLine);
|
|
128
|
-
/**
|
|
129
|
-
* Note: Disabled
|
|
130
|
-
*
|
|
131
|
-
* This splits the output into lines that fit within the current
|
|
132
|
-
* terminal width, however this makes copying json objects that
|
|
133
|
-
* span across multiple lines difficult, as it introduces
|
|
134
|
-
* whitespace & line breaks
|
|
135
|
-
*/
|
|
136
|
-
// const maxWidth = process.stdout.columns - 2;
|
|
137
|
-
// if (!maxWidth || maxWidth < 10 || fullLine.length < maxWidth) {
|
|
138
|
-
// console.log(prefix, fullLine);
|
|
139
|
-
// } else {
|
|
140
|
-
// for (let i = 0; i < fullLine.length; i += maxWidth) {
|
|
141
|
-
// const part = fullLine.substring(i, i + maxWidth);
|
|
142
|
-
// console.log(prefix, part);
|
|
143
|
-
// }
|
|
144
|
-
// }
|
|
145
123
|
}
|
|
146
124
|
}
|
|
147
125
|
exports.DeviceLogProvider = DeviceLogProvider;
|
|
148
126
|
yok_1.injector.register("deviceLogProvider", DeviceLogProvider);
|
|
149
|
-
//# sourceMappingURL=device-log-provider.js.map
|
|
@@ -6,7 +6,6 @@ const _ = require("lodash");
|
|
|
6
6
|
const yok_1 = require("../yok");
|
|
7
7
|
class EmulatorHelper {
|
|
8
8
|
constructor() {
|
|
9
|
-
// https://developer.android.com/guide/topics/manifest/uses-sdk-element
|
|
10
9
|
this.mapAndroidApiLevelToVersion = {
|
|
11
10
|
"android-34": "14.0.0",
|
|
12
11
|
"android-33": "13.0.0",
|
|
@@ -79,9 +78,7 @@ class EmulatorHelper {
|
|
|
79
78
|
emulator.identifier = emulatorId;
|
|
80
79
|
emulator.status = constants_1.RUNNING_EMULATOR_STATUS;
|
|
81
80
|
emulator.type = constants_1.DeviceTypes.Device;
|
|
82
|
-
//emulator.isTablet; // TODO: consider to do this here!!!
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
exports.EmulatorHelper = EmulatorHelper;
|
|
86
84
|
yok_1.injector.register("emulatorHelper", EmulatorHelper);
|
|
87
|
-
//# sourceMappingURL=emulator-helper.js.map
|
|
@@ -144,11 +144,9 @@ class IOSApplicationManager extends application_manager_base_1.ApplicationManage
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
getDebuggableApps() {
|
|
147
|
-
// Implement when we can find debuggable applications for iOS.
|
|
148
147
|
return Promise.resolve([]);
|
|
149
148
|
}
|
|
150
149
|
getDebuggableAppViews(appIdentifiers) {
|
|
151
|
-
// Implement when we can find debuggable applications for iOS.
|
|
152
150
|
return Promise.resolve(null);
|
|
153
151
|
}
|
|
154
152
|
}
|
|
@@ -159,4 +157,3 @@ __decorate([
|
|
|
159
157
|
(0, decorators_1.cache)()
|
|
160
158
|
], IOSApplicationManager.prototype, "startDeviceLog", null);
|
|
161
159
|
exports.IOSApplicationManager = IOSApplicationManager;
|
|
162
|
-
//# sourceMappingURL=ios-application-manager.js.map
|
|
@@ -58,7 +58,6 @@ class IOSDeviceOperations extends events_1.EventEmitter {
|
|
|
58
58
|
if (options && options.shouldReturnImmediateResult) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
// We need this because we need to make sure that we have devices.
|
|
62
61
|
yield new Promise((resolve, reject) => {
|
|
63
62
|
let iterationsCount = 0;
|
|
64
63
|
const maxIterationsCount = 3;
|
|
@@ -155,8 +154,6 @@ class IOSDeviceOperations extends events_1.EventEmitter {
|
|
|
155
154
|
});
|
|
156
155
|
}
|
|
157
156
|
dispose(signal) {
|
|
158
|
-
// We need to check if we should dispose the device lib.
|
|
159
|
-
// For example we do not want to dispose it when we start printing the device logs.
|
|
160
157
|
if (this.shouldDispose && this.deviceLib) {
|
|
161
158
|
this.deviceLib.removeAllListeners();
|
|
162
159
|
this.deviceLib.dispose(signal);
|
|
@@ -235,4 +232,3 @@ __decorate([
|
|
|
235
232
|
], IOSDeviceOperations.prototype, "attacheDeviceLogDataHandler", null);
|
|
236
233
|
exports.IOSDeviceOperations = IOSDeviceOperations;
|
|
237
234
|
yok_1.injector.register("iosDeviceOperations", IOSDeviceOperations);
|
|
238
|
-
//# sourceMappingURL=ios-device-operations.js.map
|
|
@@ -122,7 +122,6 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
122
122
|
const majorVersionAsString = productType.match(/.*?(\d+)\,(\d+)/)[1];
|
|
123
123
|
const majorVersion = parseInt(majorVersionAsString);
|
|
124
124
|
let isArm64Architecture = false;
|
|
125
|
-
//https://en.wikipedia.org/wiki/List_of_iOS_devices
|
|
126
125
|
if (_.startsWith(productType, "iphone")) {
|
|
127
126
|
isArm64Architecture = majorVersion >= 6;
|
|
128
127
|
}
|
|
@@ -133,7 +132,6 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
133
132
|
isArm64Architecture = majorVersion >= 7;
|
|
134
133
|
}
|
|
135
134
|
else if (_.startsWith(productType, "realitydevice")) {
|
|
136
|
-
// visionos
|
|
137
135
|
isArm64Architecture = true;
|
|
138
136
|
}
|
|
139
137
|
activeArchitecture = isArm64Architecture ? "arm64" : "armv7";
|
|
@@ -143,7 +141,6 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
143
141
|
getPlatform(productType) {
|
|
144
142
|
productType = productType.toLowerCase().trim();
|
|
145
143
|
if (_.startsWith(productType, "realitydevice")) {
|
|
146
|
-
// visionos
|
|
147
144
|
return this.$devicePlatformsConstants.visionOS;
|
|
148
145
|
}
|
|
149
146
|
return this.$devicePlatformsConstants.iOS;
|
|
@@ -154,4 +151,3 @@ __decorate([
|
|
|
154
151
|
], IOSDevice.prototype, "openDeviceLogStream", null);
|
|
155
152
|
exports.IOSDevice = IOSDevice;
|
|
156
153
|
yok_1.injector.register("iOSDevice", IOSDevice);
|
|
157
|
-
//# sourceMappingURL=ios-device.js.map
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const yok_1 = require("../../yok");
|
|
4
4
|
class IosDeviceProductNameMapper {
|
|
5
5
|
constructor() {
|
|
6
|
-
// http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/ios-device-types
|
|
7
6
|
this.map = {
|
|
8
7
|
"iPhone1,1": "iPhone",
|
|
9
8
|
"iPhone1,2": "iPhone 3G",
|
|
@@ -64,4 +63,3 @@ class IosDeviceProductNameMapper {
|
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
yok_1.injector.register("iOSDeviceProductNameMapper", IosDeviceProductNameMapper);
|
|
67
|
-
//# sourceMappingURL=ios-device-product-name-mapper.js.map
|
|
@@ -28,7 +28,6 @@ class IosEmulatorServices {
|
|
|
28
28
|
try {
|
|
29
29
|
if (options.platform === this.$devicePlatformsConstants.visionOS &&
|
|
30
30
|
!options.emulatorIdOrName) {
|
|
31
|
-
// find first available visionOS simulator (for now).
|
|
32
31
|
const { devices } = yield this.tryGetiOSSimDevices();
|
|
33
32
|
options.emulatorIdOrName = (_a = devices.find((device) => device.platform === this.$devicePlatformsConstants.visionOS)) === null || _a === void 0 ? void 0 : _a.id;
|
|
34
33
|
}
|
|
@@ -74,8 +73,6 @@ class IosEmulatorServices {
|
|
|
74
73
|
connectToPort(data) {
|
|
75
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
75
|
try {
|
|
77
|
-
// node v17+ resolves localhost to ::1 (ipv6) instead of 127.0.0.1 (ipv4)
|
|
78
|
-
// so we explicitly pass ipv4
|
|
79
76
|
const socket = net.connect(data.port, "127.0.0.1");
|
|
80
77
|
return socket;
|
|
81
78
|
}
|
|
@@ -140,4 +137,3 @@ class IosEmulatorServices {
|
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
139
|
yok_1.injector.register("iOSEmulatorServices", IosEmulatorServices);
|
|
143
|
-
//# sourceMappingURL=ios-emulator-services.js.map
|
|
@@ -21,4 +21,3 @@ IOSSimResolver.iOSSimName = "ios-sim-portable";
|
|
|
21
21
|
IOSSimResolver.iOSStandaloneExecutableName = "ios-sim-standalone.js";
|
|
22
22
|
exports.IOSSimResolver = IOSSimResolver;
|
|
23
23
|
yok_1.injector.register("iOSSimResolver", IOSSimResolver);
|
|
24
|
-
//# sourceMappingURL=ios-sim-resolver.js.map
|
|
@@ -95,14 +95,9 @@ class IOSSimulatorApplicationManager extends application_manager_base_1.Applicat
|
|
|
95
95
|
}
|
|
96
96
|
getDebuggableAppViews(appIdentifiers) {
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
// Implement when we can find debuggable applications for iOS.
|
|
99
98
|
return Promise.resolve(null);
|
|
100
99
|
});
|
|
101
100
|
}
|
|
102
|
-
// iOS will kill the app if we freeze it in the NativeScript Runtime and wait for debug-brk.
|
|
103
|
-
// In order to avoid that, we are attaching lldb and passing it "process continue".
|
|
104
|
-
// In this way, iOS will not kill the app because it has a native debugger attached
|
|
105
|
-
// and the users will be able to attach a debug session using the debug-brk flag.
|
|
106
101
|
attachNativeDebugger(appId, pid) {
|
|
107
102
|
this._lldbProcesses[appId] = this.$childProcess.spawn("lldb", ["-p", pid]);
|
|
108
103
|
if (log4js.levels.TRACE.isGreaterThanOrEqualTo(this.$logger.getLevel())) {
|
|
@@ -150,4 +145,3 @@ __decorate([
|
|
|
150
145
|
(0, decorators_1.cache)()
|
|
151
146
|
], IOSSimulatorApplicationManager.prototype, "startDeviceLog", null);
|
|
152
147
|
exports.IOSSimulatorApplicationManager = IOSSimulatorApplicationManager;
|
|
153
|
-
//# sourceMappingURL=ios-simulator-application-manager.js.map
|
|
@@ -80,15 +80,11 @@ class IOSSimulator extends ios_device_base_1.IOSDeviceBase {
|
|
|
80
80
|
let socket;
|
|
81
81
|
const attachRequestMessage = this.$iOSNotification.getAttachRequest(appId, this.deviceInfo.identifier);
|
|
82
82
|
yield this.$iOSEmulatorServices.postDarwinNotification(attachRequestMessage, this.deviceInfo.identifier);
|
|
83
|
-
// Retry posting the notification every five seconds, in case the AttachRequest
|
|
84
|
-
// event handler wasn't registered when the first one was sent
|
|
85
83
|
const postNotificationRetryInterval = setInterval(() => {
|
|
86
84
|
this.$iOSEmulatorServices
|
|
87
85
|
.postDarwinNotification(attachRequestMessage, this.deviceInfo.identifier)
|
|
88
86
|
.catch((e) => this.$logger.error(e));
|
|
89
87
|
}, 5e3);
|
|
90
|
-
// the internal retry-mechanism of getDebuggerPort will ensure the above
|
|
91
|
-
// interval has a chance to execute multiple times
|
|
92
88
|
const port = yield _super.getDebuggerPort.call(this, appId).finally(() => {
|
|
93
89
|
clearInterval(postNotificationRetryInterval);
|
|
94
90
|
});
|
|
@@ -108,4 +104,3 @@ __decorate([
|
|
|
108
104
|
(0, decorators_1.cache)()
|
|
109
105
|
], IOSSimulator.prototype, "openDeviceLogStream", null);
|
|
110
106
|
exports.IOSSimulator = IOSSimulator;
|
|
111
|
-
//# sourceMappingURL=ios-simulator-device.js.map
|
|
@@ -24,7 +24,6 @@ class LogFilter {
|
|
|
24
24
|
if (deviceLogFilter) {
|
|
25
25
|
return deviceLogFilter.filterData(data, loggingOptions);
|
|
26
26
|
}
|
|
27
|
-
// In case the platform is not valid, just return the data without filtering.
|
|
28
27
|
return data;
|
|
29
28
|
}
|
|
30
29
|
getDeviceLogFilterInstance(platform) {
|
|
@@ -50,4 +49,3 @@ class LogFilter {
|
|
|
50
49
|
}
|
|
51
50
|
exports.LogFilter = LogFilter;
|
|
52
51
|
yok_1.injector.register("logFilter", LogFilter);
|
|
53
|
-
//# sourceMappingURL=log-filter.js.map
|
|
@@ -54,7 +54,6 @@ class AndroidDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
54
54
|
checkCurrentData(result) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
const currentDevices = result.map((element) => {
|
|
57
|
-
// http://developer.android.com/tools/help/adb.html#devicestatus
|
|
58
57
|
const data = element.split("\t");
|
|
59
58
|
const identifier = data[0];
|
|
60
59
|
const status = data[1];
|
|
@@ -90,4 +89,3 @@ class AndroidDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
90
89
|
}
|
|
91
90
|
exports.AndroidDeviceDiscovery = AndroidDeviceDiscovery;
|
|
92
91
|
yok_1.injector.register("androidDeviceDiscovery", AndroidDeviceDiscovery);
|
|
93
|
-
//# sourceMappingURL=android-device-discovery.js.map
|
|
@@ -31,11 +31,9 @@ class AndroidEmulatorDiscovery extends events_1.EventEmitter {
|
|
|
31
31
|
const availableEmulatorsOutput = yield this.$androidEmulatorServices.getEmulatorImages();
|
|
32
32
|
const currentEmulators = availableEmulatorsOutput.devices;
|
|
33
33
|
const cachedEmulators = _.values(this._emulators);
|
|
34
|
-
// Remove old emulators
|
|
35
34
|
const lostEmulators = _(cachedEmulators)
|
|
36
35
|
.reject((e) => _.some(currentEmulators, (emulator) => emulator && e && emulator.imageIdentifier === e.imageIdentifier))
|
|
37
36
|
.value();
|
|
38
|
-
// Add new emulators
|
|
39
37
|
const foundEmulators = _(currentEmulators)
|
|
40
38
|
.reject((e) => _.some(cachedEmulators, (emulator) => emulator && e && emulator.imageIdentifier === e.imageIdentifier))
|
|
41
39
|
.value();
|
|
@@ -65,4 +63,3 @@ class AndroidEmulatorDiscovery extends events_1.EventEmitter {
|
|
|
65
63
|
}
|
|
66
64
|
exports.AndroidEmulatorDiscovery = AndroidEmulatorDiscovery;
|
|
67
65
|
yok_1.injector.register("androidEmulatorDiscovery", AndroidEmulatorDiscovery);
|
|
68
|
-
//# sourceMappingURL=android-emulator-discovery.js.map
|
|
@@ -87,19 +87,6 @@ class AndroidProcessService {
|
|
|
87
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
88
|
const adb = this.getAdb(deviceIdentifier);
|
|
89
89
|
const androidWebViewPortInformation = (yield this.getAbstractPortsInformation(adb)).split(os_1.EOL);
|
|
90
|
-
// TODO: Add tests and make sure only unique names are returned. Input before groupBy is:
|
|
91
|
-
// [ { deviceIdentifier: 'SH26BW100473',
|
|
92
|
-
// appIdentifier: 'com.telerik.EmptyNS',
|
|
93
|
-
// framework: 'NativeScript' },
|
|
94
|
-
// { deviceIdentifier: 'SH26BW100473',
|
|
95
|
-
// appIdentifier: 'com.telerik.EmptyNS',
|
|
96
|
-
// framework: 'Cordova' },
|
|
97
|
-
// { deviceIdentifier: 'SH26BW100473',
|
|
98
|
-
// appIdentifier: 'chrome',
|
|
99
|
-
// framework: 'Cordova' },
|
|
100
|
-
// { deviceIdentifier: 'SH26BW100473',
|
|
101
|
-
// appIdentifier: 'chrome',
|
|
102
|
-
// framework: 'Cordova' } ]
|
|
103
90
|
const portInformation = yield Promise.all(_.map(androidWebViewPortInformation, (line) => __awaiter(this, void 0, void 0, function* () {
|
|
104
91
|
return (yield this.getApplicationInfoFromWebViewPortInformation(adb, deviceIdentifier, line)) ||
|
|
105
92
|
(yield this.getNativeScriptApplicationInformation(adb, deviceIdentifier, line));
|
|
@@ -148,7 +135,6 @@ class AndroidProcessService {
|
|
|
148
135
|
}
|
|
149
136
|
getApplicationInfoFromWebViewPortInformation(adb, deviceIdentifier, information) {
|
|
150
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
// Need to search by processId to check for old Android webviews (@webview_devtools_remote_<processId>).
|
|
152
138
|
const processIdRegExp = /@webview_devtools_remote_(.+)/g;
|
|
153
139
|
const processIdMatches = processIdRegExp.exec(information);
|
|
154
140
|
let cordovaAppIdentifier;
|
|
@@ -157,7 +143,6 @@ class AndroidProcessService {
|
|
|
157
143
|
cordovaAppIdentifier = yield this.getApplicationIdentifierFromPid(adb, processId);
|
|
158
144
|
}
|
|
159
145
|
else {
|
|
160
|
-
// Search for appIdentifier (@<appIdentifier>_devtools_remote).
|
|
161
146
|
const chromeAppIdentifierRegExp = /@(.+)_devtools_remote\s?/g;
|
|
162
147
|
const chromeAppIdentifierMatches = chromeAppIdentifierRegExp.exec(information);
|
|
163
148
|
if (chromeAppIdentifierMatches && chromeAppIdentifierMatches.length > 0) {
|
|
@@ -176,7 +161,6 @@ class AndroidProcessService {
|
|
|
176
161
|
}
|
|
177
162
|
getNativeScriptApplicationInformation(adb, deviceIdentifier, information) {
|
|
178
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
// Search for appIdentifier (@<appIdentifier-debug>).
|
|
180
164
|
const nativeScriptAppIdentifierRegExp = /@(.+)-(debug|inspectorServer)/g;
|
|
181
165
|
const nativeScriptAppIdentifierMatches = nativeScriptAppIdentifierRegExp.exec(information);
|
|
182
166
|
if (nativeScriptAppIdentifierMatches &&
|
|
@@ -193,10 +177,6 @@ class AndroidProcessService {
|
|
|
193
177
|
}
|
|
194
178
|
getAbstractPortForApplication(adb, processId, appIdentifier, abstractPortsInformation, framework) {
|
|
195
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
// The result will look like this (without the columns names):
|
|
197
|
-
// Num RefCount Protocol Flags Type St Inode Path
|
|
198
|
-
// 0000000000000000: 00000002 00000000 00010000 0001 01 189004 @webview_devtools_remote_25512
|
|
199
|
-
// The Path column is the abstract port.
|
|
200
180
|
framework = framework || "";
|
|
201
181
|
switch (framework.toLowerCase()) {
|
|
202
182
|
case constants_1.TARGET_FRAMEWORK_IDENTIFIERS.Cordova.toLowerCase():
|
|
@@ -227,9 +207,6 @@ class AndroidProcessService {
|
|
|
227
207
|
}
|
|
228
208
|
getProcessIds(adb, appIdentifiers) {
|
|
229
209
|
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
// Process information will look like this (without the columns names):
|
|
231
|
-
// USER PID PPID VSIZE RSS WCHAN PC NAME
|
|
232
|
-
// u0_a63 25512 1334 1519560 96040 ffffffff f76a8f75 S com.telerik.appbuildertabstest
|
|
233
210
|
const result = {};
|
|
234
211
|
const processIdInformation = yield adb.executeShellCommand(["ps"]);
|
|
235
212
|
_.each(appIdentifiers, (appIdentifier) => {
|
|
@@ -242,11 +219,6 @@ class AndroidProcessService {
|
|
|
242
219
|
getAlreadyMappedPort(adb, deviceIdentifier, abstractPort, adbForwardList) {
|
|
243
220
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
221
|
const allForwardedPorts = adbForwardList || (yield adb.executeCommand(["forward", "--list"])) || "";
|
|
245
|
-
// Sample output:
|
|
246
|
-
// 5e2e580b tcp:62503 localabstract:webview_devtools_remote_7985
|
|
247
|
-
// 5e2e580b tcp:62524 localabstract:webview_devtools_remote_7986
|
|
248
|
-
// 5e2e580b tcp:63160 localabstract:webview_devtools_remote_7987
|
|
249
|
-
// 5e2e580b tcp:57577 localabstract:com.telerik.nrel-debug
|
|
250
222
|
const regex = new RegExp(`${deviceIdentifier}\\s+?tcp:(\\d+?)\\s+?.*?${abstractPort}$`);
|
|
251
223
|
return this.getFirstMatchingGroupFromMultilineResult(allForwardedPorts, regex);
|
|
252
224
|
});
|
|
@@ -262,9 +234,6 @@ class AndroidProcessService {
|
|
|
262
234
|
getApplicationIdentifierFromPid(adb, pid, psData) {
|
|
263
235
|
return __awaiter(this, void 0, void 0, function* () {
|
|
264
236
|
psData = psData || (yield adb.executeShellCommand(["ps"]));
|
|
265
|
-
// Process information will look like this (without the columns names):
|
|
266
|
-
// USER PID PPID VSIZE RSS WCHAN PC NAME
|
|
267
|
-
// u0_a63 25512 1334 1519560 96040 ffffffff f76a8f75 S com.telerik.appbuildertabstest
|
|
268
237
|
return this.getFirstMatchingGroupFromMultilineResult(psData, new RegExp(`\\s+${pid}(?:\\s+\\d+){3}\\s+.*\\s+(.*?)$`));
|
|
269
238
|
});
|
|
270
239
|
}
|
|
@@ -288,4 +257,3 @@ __decorate([
|
|
|
288
257
|
], AndroidProcessService.prototype, "getAppProcessId", null);
|
|
289
258
|
exports.AndroidProcessService = AndroidProcessService;
|
|
290
259
|
yok_1.injector.register("androidProcessService", AndroidProcessService);
|
|
291
|
-
//# sourceMappingURL=android-process-service.js.map
|
|
@@ -72,7 +72,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
72
72
|
const device = yield this.getDevice(options.deviceId);
|
|
73
73
|
return device;
|
|
74
74
|
}
|
|
75
|
-
// Now let's take data for each device:
|
|
76
75
|
const availableDevicesAndEmulators = this.getDeviceInstances().filter((d) => d.deviceInfo.status === constants_2.CONNECTED_STATUS &&
|
|
77
76
|
(!this.platform ||
|
|
78
77
|
d.deviceInfo.platform.toLowerCase() === this.platform.toLowerCase()));
|
|
@@ -95,8 +94,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
95
94
|
const devices = sortedInstances.filter((d) => !d.isEmulator);
|
|
96
95
|
let selectedInstance;
|
|
97
96
|
if (options.onlyEmulators || options.onlyDevices) {
|
|
98
|
-
// When --emulator or --forDevice is passed, the instances are already filtered
|
|
99
|
-
// So we are sure we have exactly the type we need and we can safely return the last one (highest OS version).
|
|
100
97
|
selectedInstance = _.last(sortedInstances);
|
|
101
98
|
}
|
|
102
99
|
else {
|
|
@@ -159,7 +156,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
159
156
|
...additionalErrors,
|
|
160
157
|
];
|
|
161
158
|
}
|
|
162
|
-
// emulator is already running
|
|
163
159
|
if (emulator.status === constants.RUNNING_EMULATOR_STATUS) {
|
|
164
160
|
return null;
|
|
165
161
|
}
|
|
@@ -192,11 +188,9 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
192
188
|
return !!(this.$mobileHelper.isiOSPlatform(device.deviceInfo.platform) &&
|
|
193
189
|
device.isEmulator);
|
|
194
190
|
}
|
|
195
|
-
/* tslint:disable:no-unused-variable */
|
|
196
191
|
setLogLevel(logLevel, deviceIdentifier) {
|
|
197
192
|
this.$deviceLogProvider.setLogLevel(logLevel, deviceIdentifier);
|
|
198
193
|
}
|
|
199
|
-
/* tslint:enable:no-unused-variable */
|
|
200
194
|
isAppInstalledOnDevices(deviceIdentifiers, appId, projectName, projectDir) {
|
|
201
195
|
this.$logger.trace(`Called isInstalledOnDevices for identifiers ${deviceIdentifiers}. AppIdentifier is ${appId}.`);
|
|
202
196
|
return _.map(deviceIdentifiers, (deviceIdentifier) => this.isApplicationInstalledOnDevice(deviceIdentifier, {
|
|
@@ -270,9 +264,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
270
264
|
delete this._availableEmulators[emulator.imageIdentifier];
|
|
271
265
|
this.emit(constants.EmulatorDiscoveryNames.EMULATOR_IMAGE_LOST, emulator);
|
|
272
266
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Starts looking for devices. Any found devices are pushed to "_devices" variable.
|
|
275
|
-
*/
|
|
276
267
|
detectCurrentlyAttachedDevices(deviceInitOpts) {
|
|
277
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
278
269
|
const options = this.getDeviceLookingOptions(deviceInitOpts);
|
|
@@ -345,11 +336,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
345
336
|
clearInterval(this.emulatorDetectionInterval);
|
|
346
337
|
}
|
|
347
338
|
}
|
|
348
|
-
/**
|
|
349
|
-
* Returns device that matches an identifier.
|
|
350
|
-
* The identifier is expected to be the same as the running device declares it (emulator-5554 for android or GUID for ios).
|
|
351
|
-
* @param identifier running emulator or device identifier
|
|
352
|
-
*/
|
|
353
339
|
getDeviceByIdentifier(identifier) {
|
|
354
340
|
const searchedDevice = _.find(this.getDeviceInstances(), (device) => {
|
|
355
341
|
if (this.$mobileHelper.isApplePlatform(device.deviceInfo.platform) &&
|
|
@@ -365,9 +351,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
365
351
|
}
|
|
366
352
|
return searchedDevice;
|
|
367
353
|
}
|
|
368
|
-
/**
|
|
369
|
-
* Starts looking for running devices. All found devices are pushed to _devices variable.
|
|
370
|
-
*/
|
|
371
354
|
startLookingForDevices(deviceInitOpts) {
|
|
372
355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
356
|
this.$logger.trace("startLookingForDevices; platform is %s", this._platform);
|
|
@@ -379,20 +362,10 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
379
362
|
yield this.startDeviceDetectionInterval(deviceInitOpts);
|
|
380
363
|
});
|
|
381
364
|
}
|
|
382
|
-
/**
|
|
383
|
-
* Returns device depending on the passed index.
|
|
384
|
-
* The index refers to assigned number to listed devices by tns device command.
|
|
385
|
-
* @param index assigned device number
|
|
386
|
-
*/
|
|
387
365
|
getDeviceByIndex(index) {
|
|
388
366
|
this.validateIndex(index - 1);
|
|
389
367
|
return this.getDeviceInstances()[index - 1];
|
|
390
368
|
}
|
|
391
|
-
/**
|
|
392
|
-
* Returns running device for specified --device <DeviceId>.
|
|
393
|
-
* Method expects running devices.
|
|
394
|
-
* @param deviceOption parameter passed by the user to --device flag. Can be name, identifier or imageIdentifier.
|
|
395
|
-
*/
|
|
396
369
|
getDevice(deviceOption) {
|
|
397
370
|
return __awaiter(this, void 0, void 0, function* () {
|
|
398
371
|
let device = null;
|
|
@@ -414,11 +387,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
414
387
|
return device;
|
|
415
388
|
});
|
|
416
389
|
}
|
|
417
|
-
/**
|
|
418
|
-
* Method runs action for a --device (value), specified by the user.
|
|
419
|
-
* @param action action to be executed if canExecute returns true
|
|
420
|
-
* @param canExecute predicate to decide whether the command can be ran
|
|
421
|
-
*/
|
|
422
390
|
executeOnDevice(action, canExecute) {
|
|
423
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
424
392
|
if (!canExecute || canExecute(this._device)) {
|
|
@@ -429,11 +397,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
429
397
|
}
|
|
430
398
|
});
|
|
431
399
|
}
|
|
432
|
-
/**
|
|
433
|
-
* Executes passed action for each found device.
|
|
434
|
-
* @param action action to be executed if canExecute returns true
|
|
435
|
-
* @param canExecute predicate to decide whether the command can be ran
|
|
436
|
-
*/
|
|
437
400
|
executeOnAllConnectedDevices(action, canExecute) {
|
|
438
401
|
return __awaiter(this, void 0, void 0, function* () {
|
|
439
402
|
const devices = this.filterDevicesByPlatform();
|
|
@@ -487,12 +450,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
487
450
|
});
|
|
488
451
|
}));
|
|
489
452
|
}
|
|
490
|
-
/**
|
|
491
|
-
* Runs the passed action if the predicate "canExecute" returns true
|
|
492
|
-
* @param action action to be executed if canExecute returns true.
|
|
493
|
-
* @param canExecute predicate to decide whether the command can be ran
|
|
494
|
-
* @param options all possible options that can be passed to the command.
|
|
495
|
-
*/
|
|
496
453
|
execute(action, canExecute, options) {
|
|
497
454
|
return __awaiter(this, void 0, void 0, function* () {
|
|
498
455
|
assert.ok(this._isInitialized, "Devices services not initialized!");
|
|
@@ -502,7 +459,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
502
459
|
this.$mobileHelper.isiOSPlatform(this._platform) &&
|
|
503
460
|
this.$options.emulator &&
|
|
504
461
|
!this.isOnlyiOSSimultorRunning()) {
|
|
505
|
-
// Executes the command only on iOS simulator
|
|
506
462
|
const originalCanExecute = canExecute;
|
|
507
463
|
canExecute = (dev) => this.isiOSSimulator(dev) &&
|
|
508
464
|
(!originalCanExecute || !!originalCanExecute(dev));
|
|
@@ -527,11 +483,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
527
483
|
}
|
|
528
484
|
});
|
|
529
485
|
}
|
|
530
|
-
/**
|
|
531
|
-
* Starts emulator or simulator if necessary depending on --device or --emulator flags.
|
|
532
|
-
* If no options are passed runs default emulator/simulator if no devices are connected.
|
|
533
|
-
* @param deviceInitOpts mainly contains information about --emulator and --deviceId flags.
|
|
534
|
-
*/
|
|
535
486
|
startEmulatorIfNecessary(deviceInitOpts) {
|
|
536
487
|
return __awaiter(this, void 0, void 0, function* () {
|
|
537
488
|
if (deviceInitOpts && deviceInitOpts.deviceId && deviceInitOpts.emulator) {
|
|
@@ -541,7 +492,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
541
492
|
if (deviceInitOpts &&
|
|
542
493
|
deviceInitOpts.platform &&
|
|
543
494
|
!deviceInitOpts.skipEmulatorStart) {
|
|
544
|
-
// are there any running devices
|
|
545
495
|
this._platform = deviceInitOpts.platform;
|
|
546
496
|
try {
|
|
547
497
|
yield this.startLookingForDevices(deviceInitOpts);
|
|
@@ -569,11 +519,9 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
569
519
|
_startEmulatorIfNecessary(data) {
|
|
570
520
|
return __awaiter(this, void 0, void 0, function* () {
|
|
571
521
|
const deviceInstances = this.getDeviceInstances();
|
|
572
|
-
//if no --device is passed and no devices are found, the default emulator is started
|
|
573
522
|
if (!data.deviceId && _.isEmpty(deviceInstances)) {
|
|
574
523
|
return this.startEmulatorCore(data);
|
|
575
524
|
}
|
|
576
|
-
//check if --device(value) is running, if it's not or it's not the same as is specified, start with name from --device(value)
|
|
577
525
|
if (data.deviceId) {
|
|
578
526
|
if (!helpers.isNumberWithoutExponent(data.deviceId)) {
|
|
579
527
|
const activeDeviceInstance = _.find(deviceInstances, (device) => device.deviceInfo.identifier === data.deviceId);
|
|
@@ -582,7 +530,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
582
530
|
}
|
|
583
531
|
}
|
|
584
532
|
}
|
|
585
|
-
// make sure if the target platform is visionOS we don't try to run it on an already running iOS simulator...
|
|
586
533
|
if (data.platform === this.$devicePlatformsConstants.visionOS &&
|
|
587
534
|
deviceInstances.length) {
|
|
588
535
|
const runningDeviceInstance = deviceInstances.find((device) => device.deviceInfo.platform === this.$devicePlatformsConstants.visionOS);
|
|
@@ -590,7 +537,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
590
537
|
return this.startEmulatorCore(data);
|
|
591
538
|
}
|
|
592
539
|
}
|
|
593
|
-
// if only emulator flag is passed and no other emulators are running, start default emulator
|
|
594
540
|
if (data.emulator && deviceInstances.length) {
|
|
595
541
|
const runningDeviceInstance = _.some(deviceInstances, (value) => value.isEmulator);
|
|
596
542
|
if (!runningDeviceInstance) {
|
|
@@ -599,12 +545,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
599
545
|
}
|
|
600
546
|
});
|
|
601
547
|
}
|
|
602
|
-
/**
|
|
603
|
-
* Takes care of gathering information about all running devices.
|
|
604
|
-
* Sets "_isInitialized" to true after infomation is present.
|
|
605
|
-
* Method expects running devices.
|
|
606
|
-
* @param data mainly contains information about --emulator and --deviceId flags.
|
|
607
|
-
*/
|
|
608
548
|
initialize(data) {
|
|
609
549
|
return __awaiter(this, void 0, void 0, function* () {
|
|
610
550
|
if (!this._deviceInitializePromise) {
|
|
@@ -614,7 +554,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
614
554
|
yield this._deviceInitializePromise;
|
|
615
555
|
}
|
|
616
556
|
catch (err) {
|
|
617
|
-
// In case the initalization fails, we want to allow calling `initlialize` again with other arguments for example, so remove the cached promise value.
|
|
618
557
|
this.$logger.trace(`Error while initializing devicesService: ${err}`);
|
|
619
558
|
this._deviceInitializePromise = null;
|
|
620
559
|
throw err;
|
|
@@ -640,7 +579,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
640
579
|
deviceInitOpts = deviceInitOpts || {};
|
|
641
580
|
this._data = deviceInitOpts;
|
|
642
581
|
if (!deviceInitOpts.skipEmulatorStart) {
|
|
643
|
-
// TODO: Remove from here as it calls startLookingForDevices, so we double the calls to specific device detection services
|
|
644
582
|
yield this.startEmulatorIfNecessary(deviceInitOpts);
|
|
645
583
|
}
|
|
646
584
|
const platform = deviceInitOpts.platform;
|
|
@@ -671,7 +609,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
671
609
|
yield this.startLookingForDevices(deviceLookingOptions);
|
|
672
610
|
}
|
|
673
611
|
else {
|
|
674
|
-
// platform and deviceId are not specified
|
|
675
612
|
if (deviceInitOpts.skipInferPlatform) {
|
|
676
613
|
if (deviceInitOpts.skipDeviceDetectionInterval) {
|
|
677
614
|
yield this.detectCurrentlyAttachedDevices(deviceLookingOptions);
|
|
@@ -786,11 +723,6 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
786
723
|
}
|
|
787
724
|
return null;
|
|
788
725
|
}
|
|
789
|
-
/**
|
|
790
|
-
* Starts emulator for platform and makes sure started devices/emulators/simulators are in _devices array before finishing.
|
|
791
|
-
* @param platform (optional) platform to start emulator/simulator for
|
|
792
|
-
* @param emulatorIdOrName (optional) emulator/simulator image identifier or name
|
|
793
|
-
*/
|
|
794
726
|
startEmulatorCore(deviceInitOpts = {}) {
|
|
795
727
|
return __awaiter(this, void 0, void 0, function* () {
|
|
796
728
|
const { deviceId } = deviceInitOpts;
|
|
@@ -920,4 +852,3 @@ __decorate([
|
|
|
920
852
|
], DevicesService.prototype, "getDebuggableViews", null);
|
|
921
853
|
exports.DevicesService = DevicesService;
|
|
922
854
|
yok_1.injector.register("devicesService", DevicesService);
|
|
923
|
-
//# sourceMappingURL=devices-service.js.map
|