nativescript 9.0.0-alpha.13 → 9.0.0-alpha.14
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/config/test-deps-versions-generated.json +2 -2
- package/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-get.md +36 -0
- package/docs/man_pages/config/config-set.md +40 -0
- package/docs/man_pages/config/config.md +39 -0
- package/docs/man_pages/project/hooks/hooks.md +35 -0
- package/docs/man_pages/start.md +1 -0
- package/lib/.d.ts +4 -0
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +7 -0
- package/lib/bootstrap.js +7 -1
- package/lib/bun-package-manager.js +14 -1
- package/lib/color.js +4 -0
- package/lib/commands/add-platform.js +1 -0
- package/lib/commands/apple-login.js +1 -0
- package/lib/commands/appstore-list.js +1 -0
- package/lib/commands/appstore-upload.js +3 -0
- package/lib/commands/build.js +3 -2
- package/lib/commands/clean.js +22 -1
- package/lib/commands/command-base.js +1 -0
- package/lib/commands/config.js +5 -0
- package/lib/commands/create-project.js +6 -0
- package/lib/commands/debug.js +6 -1
- package/lib/commands/deploy.js +3 -2
- package/lib/commands/embedding/embed.js +7 -0
- package/lib/commands/extensibility/install-extension.js +1 -0
- package/lib/commands/extensibility/list-extensions.js +1 -0
- package/lib/commands/extensibility/uninstall-extension.js +1 -0
- package/lib/commands/fonts.js +1 -0
- package/lib/commands/generate-assets.js +1 -0
- package/lib/commands/generate-help.js +1 -0
- package/lib/commands/generate.js +48 -1
- package/lib/commands/hooks/common.js +80 -0
- package/lib/commands/hooks/hooks-lock.js +101 -0
- package/lib/commands/hooks/hooks.js +72 -0
- package/lib/commands/info.js +1 -0
- package/lib/commands/install.js +1 -0
- package/lib/commands/list-platforms.js +1 -0
- package/lib/commands/migrate.js +1 -0
- package/lib/commands/native-add.js +5 -0
- package/lib/commands/platform-clean.js +1 -0
- package/lib/commands/plugin/add-plugin.js +1 -0
- package/lib/commands/plugin/build-plugin.js +1 -0
- package/lib/commands/plugin/create-plugin.js +5 -0
- package/lib/commands/plugin/list-plugins.js +1 -0
- package/lib/commands/plugin/remove-plugin.js +2 -0
- package/lib/commands/plugin/update-plugin.js +1 -0
- package/lib/commands/post-install.js +6 -0
- package/lib/commands/prepare.js +4 -3
- package/lib/commands/preview.js +2 -0
- package/lib/commands/remove-platform.js +1 -0
- package/lib/commands/resources/resources-update.js +2 -0
- package/lib/commands/run.js +1 -0
- package/lib/commands/setup.js +1 -0
- package/lib/commands/start.js +1 -0
- package/lib/commands/test-init.js +4 -0
- package/lib/commands/test.js +9 -2
- package/lib/commands/typings.js +2 -1
- package/lib/commands/update-platform.js +5 -0
- package/lib/commands/update.js +2 -0
- package/lib/commands/widget.js +20 -1
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -0
- package/lib/common/codeGeneration/code-entity.js +1 -0
- package/lib/common/codeGeneration/code-printer.js +1 -0
- package/lib/common/command-params.js +1 -0
- package/lib/common/commands/analytics.js +3 -0
- package/lib/common/commands/autocompletion.js +3 -0
- package/lib/common/commands/device/device-log-stream.js +1 -0
- package/lib/common/commands/device/get-file.js +2 -0
- package/lib/common/commands/device/list-applications.js +1 -0
- package/lib/common/commands/device/list-devices.js +3 -0
- package/lib/common/commands/device/list-files.js +2 -0
- package/lib/common/commands/device/put-file.js +2 -0
- package/lib/common/commands/device/run-application.js +1 -0
- package/lib/common/commands/device/stop-application.js +1 -0
- package/lib/common/commands/device/uninstall-application.js +1 -0
- package/lib/common/commands/doctor.js +3 -2
- package/lib/common/commands/generate-messages.js +1 -0
- package/lib/common/commands/help.js +1 -0
- package/lib/common/commands/package-manager-get.js +1 -0
- package/lib/common/commands/package-manager-set.js +1 -0
- package/lib/common/commands/post-install.js +1 -0
- package/lib/common/commands/preuninstall.js +11 -2
- package/lib/common/commands/proxy/proxy-base.js +4 -0
- package/lib/common/commands/proxy/proxy-clear.js +1 -0
- package/lib/common/commands/proxy/proxy-get.js +1 -0
- package/lib/common/commands/proxy/proxy-set.js +1 -0
- package/lib/common/common-lib.js +1 -0
- package/lib/common/constants.js +11 -0
- package/lib/common/decorators.js +48 -0
- package/lib/common/definitions/extensibility.d.ts +2 -2
- package/lib/common/definitions/mobile.d.ts +72 -72
- package/lib/common/dispatchers.js +10 -1
- package/lib/common/errors.js +13 -3
- package/lib/common/file-system.js +13 -2
- package/lib/common/header.js +3 -0
- package/lib/common/helpers.js +89 -3
- package/lib/common/host-info.js +4 -0
- package/lib/common/http-client.js +20 -0
- package/lib/common/logger/appenders/cli-appender.js +4 -0
- package/lib/common/logger/appenders/emit-appender.js +4 -0
- package/lib/common/logger/layouts/cli-layout.js +1 -0
- package/lib/common/logger/logger.js +5 -0
- package/lib/common/messages/messages.js +6 -0
- package/lib/common/mobile/android/android-application-manager.js +20 -1
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
- package/lib/common/mobile/android/android-debug-bridge.js +6 -0
- package/lib/common/mobile/android/android-device-file-system.js +4 -0
- package/lib/common/mobile/android/android-device-hash-service.js +3 -0
- package/lib/common/mobile/android/android-device.js +8 -0
- package/lib/common/mobile/android/android-emulator-services.js +2 -1
- package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
- package/lib/common/mobile/android/android-log-filter.js +4 -0
- package/lib/common/mobile/android/android-virtual-device-service.js +26 -0
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
- package/lib/common/mobile/android/logcat-helper.js +13 -0
- package/lib/common/mobile/application-manager-base.js +6 -0
- package/lib/common/mobile/device-emitter.js +4 -0
- package/lib/common/mobile/device-log-emitter.js +1 -0
- package/lib/common/mobile/device-log-provider-base.js +1 -0
- package/lib/common/mobile/device-log-provider.js +23 -0
- package/lib/common/mobile/device-platforms-constants.js +1 -0
- package/lib/common/mobile/emulator-helper.js +3 -0
- package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
- package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
- package/lib/common/mobile/ios/device/ios-device.js +4 -0
- package/lib/common/mobile/ios/ios-device-base.js +1 -0
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
- package/lib/common/mobile/ios/ios-log-filter.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
- package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
- package/lib/common/mobile/log-filter.js +2 -0
- package/lib/common/mobile/logging-levels.js +1 -0
- package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
- package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +69 -0
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-helper.js +1 -0
- package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
- package/lib/common/opener.js +1 -0
- package/lib/common/os-info.js +1 -0
- package/lib/common/plist-parser.js +1 -0
- package/lib/common/project-helper.js +1 -0
- package/lib/common/prompter.js +9 -1
- package/lib/common/queue.js +1 -0
- package/lib/common/resource-loader.js +1 -0
- package/lib/common/services/auto-completion-service.js +13 -1
- package/lib/common/services/cancellation.js +2 -1
- package/lib/common/services/commands-service.js +17 -6
- package/lib/common/services/help-service.js +11 -3
- package/lib/common/services/hooks-service.js +13 -0
- package/lib/common/services/ios-notification-service.js +1 -0
- package/lib/common/services/json-file-settings-service.js +6 -0
- package/lib/common/services/lock-service.js +6 -0
- package/lib/common/services/message-contract-generator.js +1 -0
- package/lib/common/services/messages-service.js +1 -0
- package/lib/common/services/micro-templating-service.js +6 -0
- package/lib/common/services/net-service.js +3 -0
- package/lib/common/services/project-files-manager.js +5 -0
- package/lib/common/services/project-files-provider-base.js +1 -0
- package/lib/common/services/proxy-service.js +1 -0
- package/lib/common/services/qr.js +1 -0
- package/lib/common/services/settings-service.js +1 -0
- package/lib/common/services/xcode-select-service.js +1 -0
- package/lib/common/utils.js +1 -0
- package/lib/common/validators/project-name-validator.js +1 -0
- package/lib/common/validators/validation-result.js +1 -0
- package/lib/common/verify-node-version.js +8 -1
- package/lib/common/yok.js +32 -11
- package/lib/config.js +22 -1
- package/lib/constants-provider.js +1 -0
- package/lib/constants.js +53 -0
- package/lib/controllers/build-controller.js +4 -3
- package/lib/controllers/debug-controller.js +8 -3
- package/lib/controllers/deploy-controller.js +1 -0
- package/lib/controllers/migrate-controller.js +90 -4
- package/lib/controllers/platform-controller.js +9 -1
- package/lib/controllers/prepare-controller.js +17 -4
- package/lib/controllers/run-controller.js +17 -1
- package/lib/controllers/update-controller-base.js +1 -0
- package/lib/controllers/update-controller.js +11 -0
- package/lib/data/build-data.js +1 -0
- package/lib/data/controller-data-base.js +1 -0
- package/lib/data/debug-data.js +1 -0
- package/lib/data/platform-data.js +1 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/data/run-data.js +1 -0
- package/lib/definitions/hooks.d.ts +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
- package/lib/detached-processes/cleanup-process.js +18 -14
- package/lib/detached-processes/file-log-service.js +2 -1
- package/lib/device-path-provider.js +1 -0
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
- package/lib/device-sockets/ios/notification.js +3 -0
- package/lib/device-sockets/ios/socket-request-executor.js +3 -0
- package/lib/helpers/android-bundle-validator-helper.js +2 -1
- package/lib/helpers/deploy-command-helper.js +1 -0
- package/lib/helpers/key-command-helper.js +4 -2
- package/lib/helpers/livesync-command-helper.js +4 -1
- package/lib/helpers/network-connectivity-validator.js +1 -0
- package/lib/helpers/options-track-helper.js +3 -2
- package/lib/helpers/package-path-helper.js +1 -0
- package/lib/helpers/platform-command-helper.js +7 -2
- package/lib/helpers/version-validator-helper.js +1 -0
- package/lib/key-commands/bootstrap.js +3 -2
- package/lib/key-commands/index.js +5 -4
- package/lib/nativescript-cli-lib-bootstrap.js +4 -0
- package/lib/nativescript-cli-lib.js +1 -0
- package/lib/nativescript-cli.js +11 -1
- package/lib/node/pbxproj-dom-xcode.js +1 -0
- package/lib/node/xcode.js +1 -0
- package/lib/node-package-manager.js +11 -1
- package/lib/options.js +144 -119
- package/lib/package-installation-manager.js +8 -1
- package/lib/package-manager.js +2 -0
- package/lib/platform-command-param.js +1 -0
- package/lib/pnpm-package-manager.js +4 -1
- package/lib/project-data.js +12 -0
- package/lib/providers/project-files-provider.js +1 -0
- package/lib/resolvers/livesync-service-resolver.js +1 -0
- package/lib/services/analytics/analytics-broker-process.js +10 -6
- package/lib/services/analytics/analytics-broker.js +2 -1
- package/lib/services/analytics/analytics-service.js +29 -25
- package/lib/services/analytics/google-analytics-provider.js +13 -12
- package/lib/services/analytics-settings-service.js +5 -0
- package/lib/services/android/android-bundle-tool-service.js +1 -0
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +1 -0
- package/lib/services/android/gradle-command-service.js +1 -0
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +31 -2
- package/lib/services/android-project-service.js +71 -4
- package/lib/services/android-resources-migration-service.js +7 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
- package/lib/services/apple-portal/srp/srp-wrapper.js +4 -1
- package/lib/services/assets-generation/assets-generation-service.js +10 -5
- package/lib/services/build-artifacts-service.js +2 -1
- package/lib/services/build-data-service.js +1 -0
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/bundler/bundler-compiler-service.js +88 -17
- package/lib/services/bundler/bundler.js +1 -0
- package/lib/services/cleanup-service.js +13 -9
- package/lib/services/cocoapods-platform-manager.js +9 -0
- package/lib/services/cocoapods-service.js +21 -1
- package/lib/services/debug-data-service.js +1 -0
- package/lib/services/debug-service-base.js +7 -0
- package/lib/services/device/device-install-app-service.js +2 -1
- package/lib/services/doctor-service.js +21 -6
- package/lib/services/extensibility-service.js +9 -1
- package/lib/services/files-hash-service.js +1 -0
- package/lib/services/hmr-status-service.js +2 -0
- package/lib/services/info-service.js +1 -0
- package/lib/services/initialize-service.js +5 -1
- package/lib/services/ios/export-options-plist-service.js +4 -0
- package/lib/services/ios/ios-signing-service.js +4 -0
- package/lib/services/ios/spm-service.js +11 -0
- package/lib/services/ios/xcodebuild-args-service.js +9 -0
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +2 -1
- package/lib/services/ios-debugger-port-service.js +1 -0
- package/lib/services/ios-device-debug-service.js +1 -0
- package/lib/services/ios-entitlements-service.js +1 -0
- package/lib/services/ios-extensions-service.js +1 -0
- package/lib/services/ios-log-filter.js +20 -0
- package/lib/services/ios-native-target-service.js +6 -4
- package/lib/services/ios-project-service.js +91 -1
- package/lib/services/ios-provision-service.js +3 -0
- package/lib/services/ios-watch-app-service.js +1 -0
- package/lib/services/ip-service.js +2 -0
- package/lib/services/itmstransporter-service.js +1 -0
- package/lib/services/karma-execution.js +2 -0
- package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
- package/lib/services/livesync/android-device-livesync-service.js +2 -0
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
- package/lib/services/livesync/android-livesync-service.js +1 -0
- package/lib/services/livesync/android-livesync-tool.js +4 -0
- package/lib/services/livesync/device-livesync-service-base.js +2 -0
- package/lib/services/livesync/ios-device-livesync-service.js +7 -0
- package/lib/services/livesync/ios-livesync-service.js +2 -0
- package/lib/services/livesync/livesync-socket.js +1 -0
- package/lib/services/livesync/platform-livesync-service-base.js +5 -0
- package/lib/services/livesync-process-data-service.js +1 -0
- package/lib/services/log-parser-service.js +1 -0
- package/lib/services/log-source-map-service.js +15 -0
- package/lib/services/marking-mode-service.js +8 -5
- package/lib/services/metadata-filtering-service.js +1 -0
- package/lib/services/npm-config-service.js +4 -0
- package/lib/services/pacote-service.js +7 -0
- package/lib/services/performance-service.js +3 -1
- package/lib/services/platform/add-platform-service.js +49 -2
- package/lib/services/platform/platform-validation-service.js +1 -0
- package/lib/services/platform/prepare-native-platform-service.js +5 -2
- package/lib/services/platform-environment-requirements.js +8 -3
- package/lib/services/platform-project-service-base.js +1 -0
- package/lib/services/platforms-data-service.js +1 -0
- package/lib/services/plugins-service.js +21 -2
- package/lib/services/prepare-data-service.js +1 -0
- package/lib/services/project-backup-service.js +4 -0
- package/lib/services/project-changes-service.js +14 -3
- package/lib/services/project-cleanup-service.js +2 -0
- package/lib/services/project-config-service.js +21 -2
- package/lib/services/project-data-service.js +36 -7
- package/lib/services/project-name-service.js +1 -0
- package/lib/services/project-service.js +10 -0
- package/lib/services/project-templates-service.js +3 -2
- package/lib/services/qr-code-terminal-service.js +1 -0
- package/lib/services/require-service.js +1 -0
- package/lib/services/start-service.js +1 -0
- package/lib/services/temp-service.js +3 -0
- package/lib/services/terminal-spinner-service.js +2 -0
- package/lib/services/test-execution-service.js +9 -2
- package/lib/services/test-initialization-service.js +4 -0
- package/lib/services/timeline-profiler-service.js +1 -0
- package/lib/services/user-settings-service.js +1 -0
- package/lib/services/versions-service.js +6 -4
- package/lib/services/watch-ignore-list-service.js +1 -0
- package/lib/services/xcconfig-service.js +2 -0
- package/lib/services/xcproj-service.js +1 -0
- package/lib/shared-event-bus.js +6 -0
- package/lib/sys-info.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +12 -0
- package/lib/tools/node-modules/node-modules-builder.js +1 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
- package/lib/yarn-package-manager.js +1 -0
- package/lib/yarn2-package-manager.js +3 -0
- package/package.json +11 -10
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +1 -1
|
@@ -106,6 +106,7 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
106
106
|
const majorVersionAsString = productType.match(/.*?(\d+)\,(\d+)/)[1];
|
|
107
107
|
const majorVersion = parseInt(majorVersionAsString);
|
|
108
108
|
let isArm64Architecture = false;
|
|
109
|
+
//https://en.wikipedia.org/wiki/List_of_iOS_devices
|
|
109
110
|
if (_.startsWith(productType, "iphone")) {
|
|
110
111
|
isArm64Architecture = majorVersion >= 6;
|
|
111
112
|
}
|
|
@@ -116,6 +117,7 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
116
117
|
isArm64Architecture = majorVersion >= 7;
|
|
117
118
|
}
|
|
118
119
|
else if (_.startsWith(productType, "realitydevice")) {
|
|
120
|
+
// visionos
|
|
119
121
|
isArm64Architecture = true;
|
|
120
122
|
}
|
|
121
123
|
activeArchitecture = isArm64Architecture ? "arm64" : "armv7";
|
|
@@ -125,6 +127,7 @@ class IOSDevice extends ios_device_base_1.IOSDeviceBase {
|
|
|
125
127
|
getPlatform(productType) {
|
|
126
128
|
productType = productType.toLowerCase().trim();
|
|
127
129
|
if (_.startsWith(productType, "realitydevice")) {
|
|
130
|
+
// visionos
|
|
128
131
|
return this.$devicePlatformsConstants.visionOS;
|
|
129
132
|
}
|
|
130
133
|
return this.$devicePlatformsConstants.iOS;
|
|
@@ -135,3 +138,4 @@ __decorate([
|
|
|
135
138
|
(0, decorators_1.cache)()
|
|
136
139
|
], IOSDevice.prototype, "openDeviceLogStream", null);
|
|
137
140
|
yok_1.injector.register("iOSDevice", IOSDevice);
|
|
141
|
+
//# sourceMappingURL=ios-device.js.map
|
|
@@ -3,6 +3,7 @@ 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
|
|
6
7
|
this.map = {
|
|
7
8
|
"iPhone1,1": "iPhone",
|
|
8
9
|
"iPhone1,2": "iPhone 3G",
|
|
@@ -63,3 +64,4 @@ class IosDeviceProductNameMapper {
|
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
yok_1.injector.register("iOSDeviceProductNameMapper", IosDeviceProductNameMapper);
|
|
67
|
+
//# sourceMappingURL=ios-device-product-name-mapper.js.map
|
|
@@ -18,6 +18,7 @@ class IosEmulatorServices {
|
|
|
18
18
|
try {
|
|
19
19
|
if (options.platform === this.$devicePlatformsConstants.visionOS &&
|
|
20
20
|
!options.emulatorIdOrName) {
|
|
21
|
+
// find first available visionOS simulator (for now).
|
|
21
22
|
const { devices } = await this.tryGetiOSSimDevices();
|
|
22
23
|
options.emulatorIdOrName = (_a = devices.find((device) => device.platform === this.$devicePlatformsConstants.visionOS)) === null || _a === void 0 ? void 0 : _a.id;
|
|
23
24
|
}
|
|
@@ -51,6 +52,8 @@ class IosEmulatorServices {
|
|
|
51
52
|
}
|
|
52
53
|
async connectToPort(data) {
|
|
53
54
|
try {
|
|
55
|
+
// node v17+ resolves localhost to ::1 (ipv6) instead of 127.0.0.1 (ipv4)
|
|
56
|
+
// so we explicitly pass ipv4
|
|
54
57
|
const socket = net.connect(data.port, "127.0.0.1");
|
|
55
58
|
return socket;
|
|
56
59
|
}
|
|
@@ -108,3 +111,4 @@ class IosEmulatorServices {
|
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
yok_1.injector.register("iOSEmulatorServices", IosEmulatorServices);
|
|
114
|
+
//# sourceMappingURL=ios-emulator-services.js.map
|
|
@@ -21,3 +21,4 @@ exports.IOSSimResolver = IOSSimResolver;
|
|
|
21
21
|
IOSSimResolver.iOSSimName = "ios-sim-portable";
|
|
22
22
|
IOSSimResolver.iOSStandaloneExecutableName = "ios-sim-standalone.js";
|
|
23
23
|
yok_1.injector.register("iOSSimResolver", IOSSimResolver);
|
|
24
|
+
//# sourceMappingURL=ios-sim-resolver.js.map
|
|
@@ -73,8 +73,13 @@ class IOSSimulatorApplicationManager extends application_manager_base_1.Applicat
|
|
|
73
73
|
return [];
|
|
74
74
|
}
|
|
75
75
|
async getDebuggableAppViews(appIdentifiers) {
|
|
76
|
+
// Implement when we can find debuggable applications for iOS.
|
|
76
77
|
return Promise.resolve(null);
|
|
77
78
|
}
|
|
79
|
+
// iOS will kill the app if we freeze it in the NativeScript Runtime and wait for debug-brk.
|
|
80
|
+
// In order to avoid that, we are attaching lldb and passing it "process continue".
|
|
81
|
+
// In this way, iOS will not kill the app because it has a native debugger attached
|
|
82
|
+
// and the users will be able to attach a debug session using the debug-brk flag.
|
|
78
83
|
attachNativeDebugger(appId, pid) {
|
|
79
84
|
this._lldbProcesses[appId] = this.$childProcess.spawn("lldb", ["-p", pid]);
|
|
80
85
|
if (log4js.levels.TRACE.isGreaterThanOrEqualTo(this.$logger.getLevel())) {
|
|
@@ -116,3 +121,4 @@ __decorate([
|
|
|
116
121
|
__decorate([
|
|
117
122
|
(0, decorators_1.cache)()
|
|
118
123
|
], IOSSimulatorApplicationManager.prototype, "startDeviceLog", null);
|
|
124
|
+
//# sourceMappingURL=ios-simulator-application-manager.js.map
|
|
@@ -65,11 +65,15 @@ class IOSSimulator extends ios_device_base_1.IOSDeviceBase {
|
|
|
65
65
|
let socket;
|
|
66
66
|
const attachRequestMessage = this.$iOSNotification.getAttachRequest(appId, this.deviceInfo.identifier);
|
|
67
67
|
await this.$iOSEmulatorServices.postDarwinNotification(attachRequestMessage, this.deviceInfo.identifier);
|
|
68
|
+
// Retry posting the notification every five seconds, in case the AttachRequest
|
|
69
|
+
// event handler wasn't registered when the first one was sent
|
|
68
70
|
const postNotificationRetryInterval = setInterval(() => {
|
|
69
71
|
this.$iOSEmulatorServices
|
|
70
72
|
.postDarwinNotification(attachRequestMessage, this.deviceInfo.identifier)
|
|
71
73
|
.catch((e) => this.$logger.error(e));
|
|
72
74
|
}, 5e3);
|
|
75
|
+
// the internal retry-mechanism of getDebuggerPort will ensure the above
|
|
76
|
+
// interval has a chance to execute multiple times
|
|
73
77
|
const port = await super.getDebuggerPort(appId).finally(() => {
|
|
74
78
|
clearInterval(postNotificationRetryInterval);
|
|
75
79
|
});
|
|
@@ -88,3 +92,4 @@ exports.IOSSimulator = IOSSimulator;
|
|
|
88
92
|
__decorate([
|
|
89
93
|
(0, decorators_1.cache)()
|
|
90
94
|
], IOSSimulator.prototype, "openDeviceLogStream", null);
|
|
95
|
+
//# sourceMappingURL=ios-simulator-device.js.map
|
|
@@ -24,6 +24,7 @@ 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.
|
|
27
28
|
return data;
|
|
28
29
|
}
|
|
29
30
|
getDeviceLogFilterInstance(platform) {
|
|
@@ -49,3 +50,4 @@ class LogFilter {
|
|
|
49
50
|
}
|
|
50
51
|
exports.LogFilter = LogFilter;
|
|
51
52
|
yok_1.injector.register("logFilter", LogFilter);
|
|
53
|
+
//# sourceMappingURL=log-filter.js.map
|
|
@@ -38,6 +38,7 @@ class AndroidDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
38
38
|
}
|
|
39
39
|
async checkCurrentData(result) {
|
|
40
40
|
const currentDevices = result.map((element) => {
|
|
41
|
+
// http://developer.android.com/tools/help/adb.html#devicestatus
|
|
41
42
|
const data = element.split("\t");
|
|
42
43
|
const identifier = data[0];
|
|
43
44
|
const status = data[1];
|
|
@@ -70,3 +71,4 @@ class AndroidDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
70
71
|
}
|
|
71
72
|
exports.AndroidDeviceDiscovery = AndroidDeviceDiscovery;
|
|
72
73
|
yok_1.injector.register("androidDeviceDiscovery", AndroidDeviceDiscovery);
|
|
74
|
+
//# sourceMappingURL=android-device-discovery.js.map
|
|
@@ -21,9 +21,11 @@ class AndroidEmulatorDiscovery extends events_1.EventEmitter {
|
|
|
21
21
|
const availableEmulatorsOutput = await this.$androidEmulatorServices.getEmulatorImages();
|
|
22
22
|
const currentEmulators = availableEmulatorsOutput.devices;
|
|
23
23
|
const cachedEmulators = _.values(this._emulators);
|
|
24
|
+
// Remove old emulators
|
|
24
25
|
const lostEmulators = _(cachedEmulators)
|
|
25
26
|
.reject((e) => _.some(currentEmulators, (emulator) => emulator && e && emulator.imageIdentifier === e.imageIdentifier))
|
|
26
27
|
.value();
|
|
28
|
+
// Add new emulators
|
|
27
29
|
const foundEmulators = _(currentEmulators)
|
|
28
30
|
.reject((e) => _.some(cachedEmulators, (emulator) => emulator && e && emulator.imageIdentifier === e.imageIdentifier))
|
|
29
31
|
.value();
|
|
@@ -52,3 +54,4 @@ class AndroidEmulatorDiscovery extends events_1.EventEmitter {
|
|
|
52
54
|
}
|
|
53
55
|
exports.AndroidEmulatorDiscovery = AndroidEmulatorDiscovery;
|
|
54
56
|
yok_1.injector.register("androidEmulatorDiscovery", AndroidEmulatorDiscovery);
|
|
57
|
+
//# sourceMappingURL=android-emulator-discovery.js.map
|
|
@@ -71,6 +71,19 @@ class AndroidProcessService {
|
|
|
71
71
|
async getDebuggableApps(deviceIdentifier) {
|
|
72
72
|
const adb = this.getAdb(deviceIdentifier);
|
|
73
73
|
const androidWebViewPortInformation = (await this.getAbstractPortsInformation(adb)).split(os_1.EOL);
|
|
74
|
+
// TODO: Add tests and make sure only unique names are returned. Input before groupBy is:
|
|
75
|
+
// [ { deviceIdentifier: 'SH26BW100473',
|
|
76
|
+
// appIdentifier: 'com.telerik.EmptyNS',
|
|
77
|
+
// framework: 'NativeScript' },
|
|
78
|
+
// { deviceIdentifier: 'SH26BW100473',
|
|
79
|
+
// appIdentifier: 'com.telerik.EmptyNS',
|
|
80
|
+
// framework: 'Cordova' },
|
|
81
|
+
// { deviceIdentifier: 'SH26BW100473',
|
|
82
|
+
// appIdentifier: 'chrome',
|
|
83
|
+
// framework: 'Cordova' },
|
|
84
|
+
// { deviceIdentifier: 'SH26BW100473',
|
|
85
|
+
// appIdentifier: 'chrome',
|
|
86
|
+
// framework: 'Cordova' } ]
|
|
74
87
|
const portInformation = await Promise.all(_.map(androidWebViewPortInformation, async (line) => (await this.getApplicationInfoFromWebViewPortInformation(adb, deviceIdentifier, line)) ||
|
|
75
88
|
(await this.getNativeScriptApplicationInformation(adb, deviceIdentifier, line))));
|
|
76
89
|
return _(portInformation)
|
|
@@ -109,6 +122,7 @@ class AndroidProcessService {
|
|
|
109
122
|
return adb;
|
|
110
123
|
}
|
|
111
124
|
async getApplicationInfoFromWebViewPortInformation(adb, deviceIdentifier, information) {
|
|
125
|
+
// Need to search by processId to check for old Android webviews (@webview_devtools_remote_<processId>).
|
|
112
126
|
const processIdRegExp = /@webview_devtools_remote_(.+)/g;
|
|
113
127
|
const processIdMatches = processIdRegExp.exec(information);
|
|
114
128
|
let cordovaAppIdentifier;
|
|
@@ -117,6 +131,7 @@ class AndroidProcessService {
|
|
|
117
131
|
cordovaAppIdentifier = await this.getApplicationIdentifierFromPid(adb, processId);
|
|
118
132
|
}
|
|
119
133
|
else {
|
|
134
|
+
// Search for appIdentifier (@<appIdentifier>_devtools_remote).
|
|
120
135
|
const chromeAppIdentifierRegExp = /@(.+)_devtools_remote\s?/g;
|
|
121
136
|
const chromeAppIdentifierMatches = chromeAppIdentifierRegExp.exec(information);
|
|
122
137
|
if (chromeAppIdentifierMatches && chromeAppIdentifierMatches.length > 0) {
|
|
@@ -133,6 +148,7 @@ class AndroidProcessService {
|
|
|
133
148
|
return null;
|
|
134
149
|
}
|
|
135
150
|
async getNativeScriptApplicationInformation(adb, deviceIdentifier, information) {
|
|
151
|
+
// Search for appIdentifier (@<appIdentifier-debug>).
|
|
136
152
|
const nativeScriptAppIdentifierRegExp = /@(.+)-(debug|inspectorServer)/g;
|
|
137
153
|
const nativeScriptAppIdentifierMatches = nativeScriptAppIdentifierRegExp.exec(information);
|
|
138
154
|
if (nativeScriptAppIdentifierMatches &&
|
|
@@ -147,6 +163,10 @@ class AndroidProcessService {
|
|
|
147
163
|
return null;
|
|
148
164
|
}
|
|
149
165
|
async getAbstractPortForApplication(adb, processId, appIdentifier, abstractPortsInformation, framework) {
|
|
166
|
+
// The result will look like this (without the columns names):
|
|
167
|
+
// Num RefCount Protocol Flags Type St Inode Path
|
|
168
|
+
// 0000000000000000: 00000002 00000000 00010000 0001 01 189004 @webview_devtools_remote_25512
|
|
169
|
+
// The Path column is the abstract port.
|
|
150
170
|
framework = framework || "";
|
|
151
171
|
switch (framework.toLowerCase()) {
|
|
152
172
|
case constants_1.TARGET_FRAMEWORK_IDENTIFIERS.Cordova.toLowerCase():
|
|
@@ -173,6 +193,9 @@ class AndroidProcessService {
|
|
|
173
193
|
return match && match[1];
|
|
174
194
|
}
|
|
175
195
|
async getProcessIds(adb, appIdentifiers) {
|
|
196
|
+
// Process information will look like this (without the columns names):
|
|
197
|
+
// USER PID PPID VSIZE RSS WCHAN PC NAME
|
|
198
|
+
// u0_a63 25512 1334 1519560 96040 ffffffff f76a8f75 S com.telerik.appbuildertabstest
|
|
176
199
|
const result = {};
|
|
177
200
|
const processIdInformation = await adb.executeShellCommand(["ps"]);
|
|
178
201
|
_.each(appIdentifiers, (appIdentifier) => {
|
|
@@ -183,6 +206,11 @@ class AndroidProcessService {
|
|
|
183
206
|
}
|
|
184
207
|
async getAlreadyMappedPort(adb, deviceIdentifier, abstractPort, adbForwardList) {
|
|
185
208
|
const allForwardedPorts = adbForwardList || (await adb.executeCommand(["forward", "--list"])) || "";
|
|
209
|
+
// Sample output:
|
|
210
|
+
// 5e2e580b tcp:62503 localabstract:webview_devtools_remote_7985
|
|
211
|
+
// 5e2e580b tcp:62524 localabstract:webview_devtools_remote_7986
|
|
212
|
+
// 5e2e580b tcp:63160 localabstract:webview_devtools_remote_7987
|
|
213
|
+
// 5e2e580b tcp:57577 localabstract:com.telerik.nrel-debug
|
|
186
214
|
const regex = new RegExp(`${deviceIdentifier}\\s+?tcp:(\\d+?)\\s+?.*?${abstractPort}$`);
|
|
187
215
|
return this.getFirstMatchingGroupFromMultilineResult(allForwardedPorts, regex);
|
|
188
216
|
}
|
|
@@ -196,6 +224,9 @@ class AndroidProcessService {
|
|
|
196
224
|
}
|
|
197
225
|
async getApplicationIdentifierFromPid(adb, pid, psData) {
|
|
198
226
|
psData = psData || (await adb.executeShellCommand(["ps"]));
|
|
227
|
+
// Process information will look like this (without the columns names):
|
|
228
|
+
// USER PID PPID VSIZE RSS WCHAN PC NAME
|
|
229
|
+
// u0_a63 25512 1334 1519560 96040 ffffffff f76a8f75 S com.telerik.appbuildertabstest
|
|
199
230
|
return this.getFirstMatchingGroupFromMultilineResult(psData, new RegExp(`\\s+${pid}(?:\\s+\\d+){3}\\s+.*\\s+(.*?)$`));
|
|
200
231
|
}
|
|
201
232
|
getFirstMatchingGroupFromMultilineResult(input, regex) {
|
|
@@ -218,3 +249,4 @@ __decorate([
|
|
|
218
249
|
(0, decorators_1.exported)("androidProcessService")
|
|
219
250
|
], AndroidProcessService.prototype, "getAppProcessId", null);
|
|
220
251
|
yok_1.injector.register("androidProcessService", AndroidProcessService);
|
|
252
|
+
//# sourceMappingURL=android-process-service.js.map
|
|
@@ -62,6 +62,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
62
62
|
const device = await this.getDevice(options.deviceId);
|
|
63
63
|
return device;
|
|
64
64
|
}
|
|
65
|
+
// Now let's take data for each device:
|
|
65
66
|
const availableDevicesAndEmulators = this.getDeviceInstances().filter((d) => d.deviceInfo.status === constants_2.CONNECTED_STATUS &&
|
|
66
67
|
(!this.platform ||
|
|
67
68
|
d.deviceInfo.platform.toLowerCase() === this.platform.toLowerCase()));
|
|
@@ -84,6 +85,8 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
84
85
|
const devices = sortedInstances.filter((d) => !d.isEmulator);
|
|
85
86
|
let selectedInstance;
|
|
86
87
|
if (options.onlyEmulators || options.onlyDevices) {
|
|
88
|
+
// When --emulator or --forDevice is passed, the instances are already filtered
|
|
89
|
+
// So we are sure we have exactly the type we need and we can safely return the last one (highest OS version).
|
|
87
90
|
selectedInstance = _.last(sortedInstances);
|
|
88
91
|
}
|
|
89
92
|
else {
|
|
@@ -142,6 +145,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
142
145
|
...additionalErrors,
|
|
143
146
|
];
|
|
144
147
|
}
|
|
148
|
+
// emulator is already running
|
|
145
149
|
if (emulator.status === constants.RUNNING_EMULATOR_STATUS) {
|
|
146
150
|
return null;
|
|
147
151
|
}
|
|
@@ -173,9 +177,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
173
177
|
return !!(this.$mobileHelper.isiOSPlatform(device.deviceInfo.platform) &&
|
|
174
178
|
device.isEmulator);
|
|
175
179
|
}
|
|
180
|
+
/* tslint:disable:no-unused-variable */
|
|
176
181
|
setLogLevel(logLevel, deviceIdentifier) {
|
|
177
182
|
this.$deviceLogProvider.setLogLevel(logLevel, deviceIdentifier);
|
|
178
183
|
}
|
|
184
|
+
/* tslint:enable:no-unused-variable */
|
|
179
185
|
isAppInstalledOnDevices(deviceIdentifiers, appId, projectName, projectDir) {
|
|
180
186
|
this.$logger.trace(`Called isInstalledOnDevices for identifiers ${deviceIdentifiers}. AppIdentifier is ${appId}.`);
|
|
181
187
|
return _.map(deviceIdentifiers, (deviceIdentifier) => this.isApplicationInstalledOnDevice(deviceIdentifier, {
|
|
@@ -247,6 +253,9 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
247
253
|
delete this._availableEmulators[emulator.imageIdentifier];
|
|
248
254
|
this.emit(constants.EmulatorDiscoveryNames.EMULATOR_IMAGE_LOST, emulator);
|
|
249
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Starts looking for devices. Any found devices are pushed to "_devices" variable.
|
|
258
|
+
*/
|
|
250
259
|
async detectCurrentlyAttachedDevices(deviceInitOpts) {
|
|
251
260
|
const options = this.getDeviceLookingOptions(deviceInitOpts);
|
|
252
261
|
for (const deviceDiscovery of this._allDeviceDiscoveries) {
|
|
@@ -315,6 +324,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
315
324
|
clearInterval(this.emulatorDetectionInterval);
|
|
316
325
|
}
|
|
317
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Returns device that matches an identifier.
|
|
329
|
+
* The identifier is expected to be the same as the running device declares it (emulator-5554 for android or GUID for ios).
|
|
330
|
+
* @param identifier running emulator or device identifier
|
|
331
|
+
*/
|
|
318
332
|
getDeviceByIdentifier(identifier) {
|
|
319
333
|
const searchedDevice = _.find(this.getDeviceInstances(), (device) => {
|
|
320
334
|
if (this.$mobileHelper.isApplePlatform(device.deviceInfo.platform) &&
|
|
@@ -330,6 +344,9 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
330
344
|
}
|
|
331
345
|
return searchedDevice;
|
|
332
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Starts looking for running devices. All found devices are pushed to _devices variable.
|
|
349
|
+
*/
|
|
333
350
|
async startLookingForDevices(deviceInitOpts) {
|
|
334
351
|
this.$logger.trace("startLookingForDevices; platform is %s", this._platform);
|
|
335
352
|
if (this._platform) {
|
|
@@ -339,10 +356,20 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
339
356
|
await this.detectCurrentlyAvailableEmulators();
|
|
340
357
|
await this.startDeviceDetectionInterval(deviceInitOpts);
|
|
341
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Returns device depending on the passed index.
|
|
361
|
+
* The index refers to assigned number to listed devices by ns device command.
|
|
362
|
+
* @param index assigned device number
|
|
363
|
+
*/
|
|
342
364
|
getDeviceByIndex(index) {
|
|
343
365
|
this.validateIndex(index - 1);
|
|
344
366
|
return this.getDeviceInstances()[index - 1];
|
|
345
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Returns running device for specified --device <DeviceId>.
|
|
370
|
+
* Method expects running devices.
|
|
371
|
+
* @param deviceOption parameter passed by the user to --device flag. Can be name, identifier or imageIdentifier.
|
|
372
|
+
*/
|
|
346
373
|
async getDevice(deviceOption) {
|
|
347
374
|
let device = null;
|
|
348
375
|
if (!device) {
|
|
@@ -362,6 +389,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
362
389
|
}
|
|
363
390
|
return device;
|
|
364
391
|
}
|
|
392
|
+
/**
|
|
393
|
+
* Method runs action for a --device (value), specified by the user.
|
|
394
|
+
* @param action action to be executed if canExecute returns true
|
|
395
|
+
* @param canExecute predicate to decide whether the command can be ran
|
|
396
|
+
*/
|
|
365
397
|
async executeOnDevice(action, canExecute) {
|
|
366
398
|
if (!canExecute || canExecute(this._device)) {
|
|
367
399
|
return {
|
|
@@ -370,6 +402,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
370
402
|
};
|
|
371
403
|
}
|
|
372
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Executes passed action for each found device.
|
|
407
|
+
* @param action action to be executed if canExecute returns true
|
|
408
|
+
* @param canExecute predicate to decide whether the command can be ran
|
|
409
|
+
*/
|
|
373
410
|
async executeOnAllConnectedDevices(action, canExecute) {
|
|
374
411
|
const devices = this.filterDevicesByPlatform();
|
|
375
412
|
const sortedDevices = _.sortBy(devices, (device) => device.deviceInfo.platform);
|
|
@@ -421,6 +458,12 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
421
458
|
});
|
|
422
459
|
});
|
|
423
460
|
}
|
|
461
|
+
/**
|
|
462
|
+
* Runs the passed action if the predicate "canExecute" returns true
|
|
463
|
+
* @param action action to be executed if canExecute returns true.
|
|
464
|
+
* @param canExecute predicate to decide whether the command can be ran
|
|
465
|
+
* @param options all possible options that can be passed to the command.
|
|
466
|
+
*/
|
|
424
467
|
async execute(action, canExecute, options) {
|
|
425
468
|
assert.ok(this._isInitialized, "Devices services not initialized!");
|
|
426
469
|
if (this.hasDevices) {
|
|
@@ -429,6 +472,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
429
472
|
this.$mobileHelper.isiOSPlatform(this._platform) &&
|
|
430
473
|
this.$options.emulator &&
|
|
431
474
|
!this.isOnlyiOSSimultorRunning()) {
|
|
475
|
+
// Executes the command only on iOS simulator
|
|
432
476
|
const originalCanExecute = canExecute;
|
|
433
477
|
canExecute = (dev) => this.isiOSSimulator(dev) &&
|
|
434
478
|
(!originalCanExecute || !!originalCanExecute(dev));
|
|
@@ -452,6 +496,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
452
496
|
}
|
|
453
497
|
}
|
|
454
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Starts emulator or simulator if necessary depending on --device or --emulator flags.
|
|
501
|
+
* If no options are passed runs default emulator/simulator if no devices are connected.
|
|
502
|
+
* @param deviceInitOpts mainly contains information about --emulator and --deviceId flags.
|
|
503
|
+
*/
|
|
455
504
|
async startEmulatorIfNecessary(deviceInitOpts) {
|
|
456
505
|
if (deviceInitOpts && deviceInitOpts.deviceId && deviceInitOpts.emulator) {
|
|
457
506
|
this.$errors.fail(`--device and --emulator are incompatible options.
|
|
@@ -460,6 +509,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
460
509
|
if (deviceInitOpts &&
|
|
461
510
|
deviceInitOpts.platform &&
|
|
462
511
|
!deviceInitOpts.skipEmulatorStart) {
|
|
512
|
+
// are there any running devices
|
|
463
513
|
this._platform = deviceInitOpts.platform;
|
|
464
514
|
try {
|
|
465
515
|
await this.startLookingForDevices(deviceInitOpts);
|
|
@@ -485,9 +535,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
485
535
|
}
|
|
486
536
|
async _startEmulatorIfNecessary(data) {
|
|
487
537
|
const deviceInstances = this.getDeviceInstances();
|
|
538
|
+
//if no --device is passed and no devices are found, the default emulator is started
|
|
488
539
|
if (!data.deviceId && _.isEmpty(deviceInstances)) {
|
|
489
540
|
return this.startEmulatorCore(data);
|
|
490
541
|
}
|
|
542
|
+
//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)
|
|
491
543
|
if (data.deviceId) {
|
|
492
544
|
if (!helpers.isNumberWithoutExponent(data.deviceId)) {
|
|
493
545
|
const activeDeviceInstance = _.find(deviceInstances, (device) => device.deviceInfo.identifier === data.deviceId);
|
|
@@ -496,6 +548,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
496
548
|
}
|
|
497
549
|
}
|
|
498
550
|
}
|
|
551
|
+
// make sure if the target platform is visionOS we don't try to run it on an already running iOS simulator...
|
|
499
552
|
if (data.platform === this.$devicePlatformsConstants.visionOS &&
|
|
500
553
|
deviceInstances.length) {
|
|
501
554
|
const runningDeviceInstance = deviceInstances.find((device) => device.deviceInfo.platform ===
|
|
@@ -504,6 +557,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
504
557
|
return this.startEmulatorCore(data);
|
|
505
558
|
}
|
|
506
559
|
}
|
|
560
|
+
// if only emulator flag is passed and no other emulators are running, start default emulator
|
|
507
561
|
if (data.emulator && deviceInstances.length) {
|
|
508
562
|
const runningDeviceInstance = _.some(deviceInstances, (value) => value.isEmulator);
|
|
509
563
|
if (!runningDeviceInstance) {
|
|
@@ -511,6 +565,12 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
511
565
|
}
|
|
512
566
|
}
|
|
513
567
|
}
|
|
568
|
+
/**
|
|
569
|
+
* Takes care of gathering information about all running devices.
|
|
570
|
+
* Sets "_isInitialized" to true after infomation is present.
|
|
571
|
+
* Method expects running devices.
|
|
572
|
+
* @param data mainly contains information about --emulator and --deviceId flags.
|
|
573
|
+
*/
|
|
514
574
|
async initialize(data) {
|
|
515
575
|
if (!this._deviceInitializePromise) {
|
|
516
576
|
this._deviceInitializePromise = this.initializeCore(data);
|
|
@@ -519,6 +579,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
519
579
|
await this._deviceInitializePromise;
|
|
520
580
|
}
|
|
521
581
|
catch (err) {
|
|
582
|
+
// In case the initalization fails, we want to allow calling `initlialize` again with other arguments for example, so remove the cached promise value.
|
|
522
583
|
this.$logger.trace(`Error while initializing devicesService: ${err}`);
|
|
523
584
|
this._deviceInitializePromise = null;
|
|
524
585
|
throw err;
|
|
@@ -542,6 +603,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
542
603
|
deviceInitOpts = deviceInitOpts || {};
|
|
543
604
|
this._data = deviceInitOpts;
|
|
544
605
|
if (!deviceInitOpts.skipEmulatorStart) {
|
|
606
|
+
// TODO: Remove from here as it calls startLookingForDevices, so we double the calls to specific device detection services
|
|
545
607
|
await this.startEmulatorIfNecessary(deviceInitOpts);
|
|
546
608
|
}
|
|
547
609
|
const platform = deviceInitOpts.platform;
|
|
@@ -572,6 +634,7 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
572
634
|
await this.startLookingForDevices(deviceLookingOptions);
|
|
573
635
|
}
|
|
574
636
|
else {
|
|
637
|
+
// platform and deviceId are not specified
|
|
575
638
|
if (deviceInitOpts.skipInferPlatform) {
|
|
576
639
|
if (deviceInitOpts.skipDeviceDetectionInterval) {
|
|
577
640
|
await this.detectCurrentlyAttachedDevices(deviceLookingOptions);
|
|
@@ -679,6 +742,11 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
679
742
|
}
|
|
680
743
|
return null;
|
|
681
744
|
}
|
|
745
|
+
/**
|
|
746
|
+
* Starts emulator for platform and makes sure started devices/emulators/simulators are in _devices array before finishing.
|
|
747
|
+
* @param platform (optional) platform to start emulator/simulator for
|
|
748
|
+
* @param emulatorIdOrName (optional) emulator/simulator image identifier or name
|
|
749
|
+
*/
|
|
682
750
|
async startEmulatorCore(deviceInitOpts = {}) {
|
|
683
751
|
const { deviceId } = deviceInitOpts;
|
|
684
752
|
const platform = deviceInitOpts.platform || this._platform;
|
|
@@ -802,3 +870,4 @@ __decorate([
|
|
|
802
870
|
(0, decorators_1.exported)("devicesService")
|
|
803
871
|
], DevicesService.prototype, "getDebuggableViews", null);
|
|
804
872
|
yok_1.injector.register("devicesService", DevicesService);
|
|
873
|
+
//# sourceMappingURL=devices-service.js.map
|
|
@@ -22,6 +22,7 @@ class IOSDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (this.$mobileHelper.isvisionOSPlatform(options.platform)) {
|
|
25
|
+
// look for ios devices - same logic.
|
|
25
26
|
options.platform = this.$devicePlatformsConstants.iOS;
|
|
26
27
|
}
|
|
27
28
|
await this.$iosDeviceOperations.startLookingForDevices((deviceInfo) => {
|
|
@@ -50,3 +51,4 @@ class IOSDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
50
51
|
}
|
|
51
52
|
exports.IOSDeviceDiscovery = IOSDeviceDiscovery;
|
|
52
53
|
yok_1.injector.register("iOSDeviceDiscovery", IOSDeviceDiscovery);
|
|
54
|
+
//# sourceMappingURL=ios-device-discovery.js.map
|
|
@@ -28,12 +28,14 @@ class IOSSimulatorDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
28
28
|
async checkForDevices() {
|
|
29
29
|
if (this.$hostInfo.isDarwin) {
|
|
30
30
|
const currentSimulators = await this.$iOSSimResolver.iOSSim.getRunningSimulators();
|
|
31
|
+
// Remove old simulators
|
|
31
32
|
_(this.cachedSimulators)
|
|
32
33
|
.reject((s) => _.some(currentSimulators, (simulator) => simulator &&
|
|
33
34
|
s &&
|
|
34
35
|
simulator.id === s.id &&
|
|
35
36
|
simulator.state === s.state))
|
|
36
37
|
.each((s) => this.deleteAndRemoveDevice(s));
|
|
38
|
+
// Add new simulators
|
|
37
39
|
_(currentSimulators)
|
|
38
40
|
.reject((s) => _.some(this.cachedSimulators, (simulator) => simulator &&
|
|
39
41
|
s &&
|
|
@@ -92,3 +94,4 @@ class IOSSimulatorDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
92
94
|
}
|
|
93
95
|
exports.IOSSimulatorDiscovery = IOSSimulatorDiscovery;
|
|
94
96
|
yok_1.injector.register("iOSSimulatorDiscovery", IOSSimulatorDiscovery);
|
|
97
|
+
//# sourceMappingURL=ios-simulator-discovery.js.map
|
|
@@ -53,3 +53,4 @@ class Wp8EmulatorServices {
|
|
|
53
53
|
Wp8EmulatorServices.WP8_LAUNCHER = "XapDeployCmd.exe";
|
|
54
54
|
Wp8EmulatorServices.WP8_LAUNCHER_PATH = "Microsoft SDKs\\Windows Phone\\v8.0\\Tools\\XAP Deployment";
|
|
55
55
|
yok_1.injector.register("wp8EmulatorServices", Wp8EmulatorServices);
|
|
56
|
+
//# sourceMappingURL=wp8-emulator-services.js.map
|
package/lib/common/opener.js
CHANGED
package/lib/common/os-info.js
CHANGED
package/lib/common/prompter.js
CHANGED
|
@@ -26,6 +26,7 @@ class Prompter {
|
|
|
26
26
|
else {
|
|
27
27
|
const result = {};
|
|
28
28
|
_.each(questions, (s) => {
|
|
29
|
+
// Curly brackets needed because s.default() may return false and break the loop
|
|
29
30
|
result[s.name] = s.default();
|
|
30
31
|
});
|
|
31
32
|
return result;
|
|
@@ -122,7 +123,9 @@ class Prompter {
|
|
|
122
123
|
}
|
|
123
124
|
muteStdout() {
|
|
124
125
|
if (helpers.isInteractive()) {
|
|
125
|
-
process.stdin.setRawMode(true);
|
|
126
|
+
process.stdin.setRawMode(true); // After setting rawMode to true, Ctrl+C doesn't work for non node.js events loop i.e device log command
|
|
127
|
+
// We need to create mute-stream and to pass it as output to ctrlcReader
|
|
128
|
+
// This will prevent the prompter to show the user's text twice on the console
|
|
126
129
|
this.muteStreamInstance = new MuteStream();
|
|
127
130
|
this.muteStreamInstance.pipe(process.stdout);
|
|
128
131
|
this.muteStreamInstance.mute();
|
|
@@ -131,6 +134,7 @@ class Prompter {
|
|
|
131
134
|
output: this.muteStreamInstance,
|
|
132
135
|
});
|
|
133
136
|
this.ctrlcReader.on("SIGINT", () => {
|
|
137
|
+
// enable terminal cursor
|
|
134
138
|
process.stdout.write("\x1B[?25h");
|
|
135
139
|
process.exit();
|
|
136
140
|
});
|
|
@@ -140,6 +144,7 @@ class Prompter {
|
|
|
140
144
|
if (helpers.isInteractive()) {
|
|
141
145
|
process.stdin.setRawMode(false);
|
|
142
146
|
if (this.muteStreamInstance) {
|
|
147
|
+
// We need to clean the event listeners from the process.stdout because the MuteStream.pipe function calls the pipe function of the Node js Stream which adds event listeners and this can cause memory leak if we display more than ~10 prompts.
|
|
143
148
|
this.cleanEventListeners(process.stdout);
|
|
144
149
|
this.muteStreamInstance.unmute();
|
|
145
150
|
this.muteStreamInstance = null;
|
|
@@ -148,6 +153,8 @@ class Prompter {
|
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
155
|
cleanEventListeners(stream) {
|
|
156
|
+
// The events names and listeners names can be found here https://github.com/nodejs/node/blob/master/lib/stream.js
|
|
157
|
+
// Which event cause memory leak can be tested with stream.listeners("event-name") and if the listeners count keeps increasing with each prompt we need to remove the listener.
|
|
151
158
|
const memoryLeakEvents = [
|
|
152
159
|
{
|
|
153
160
|
eventName: "close",
|
|
@@ -174,3 +181,4 @@ class Prompter {
|
|
|
174
181
|
}
|
|
175
182
|
exports.Prompter = Prompter;
|
|
176
183
|
yok_1.injector.register("prompter", Prompter);
|
|
184
|
+
//# sourceMappingURL=prompter.js.map
|
package/lib/common/queue.js
CHANGED