nativescript 8.8.3 → 8.9.0-alpha.1

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.
Files changed (327) hide show
  1. package/lib/.d.ts +1 -0
  2. package/lib/android-tools-info.js +0 -12
  3. package/lib/base-package-manager.js +0 -7
  4. package/lib/bootstrap.js +1 -5
  5. package/lib/bun-package-manager.js +1 -17
  6. package/lib/color.js +0 -3
  7. package/lib/commands/add-platform.js +0 -1
  8. package/lib/commands/apple-login.js +0 -1
  9. package/lib/commands/appstore-list.js +0 -1
  10. package/lib/commands/appstore-upload.js +3 -10
  11. package/lib/commands/build.js +2 -3
  12. package/lib/commands/clean.js +1 -22
  13. package/lib/commands/command-base.js +0 -1
  14. package/lib/commands/config.js +0 -3
  15. package/lib/commands/create-project.js +0 -6
  16. package/lib/commands/debug.js +1 -6
  17. package/lib/commands/deploy.js +2 -3
  18. package/lib/commands/embedding/embed.js +0 -7
  19. package/lib/commands/extensibility/install-extension.js +0 -1
  20. package/lib/commands/extensibility/list-extensions.js +0 -1
  21. package/lib/commands/extensibility/uninstall-extension.js +0 -1
  22. package/lib/commands/fonts.js +0 -1
  23. package/lib/commands/generate-assets.js +0 -1
  24. package/lib/commands/generate-help.js +0 -1
  25. package/lib/commands/generate.js +2 -12
  26. package/lib/commands/info.js +0 -1
  27. package/lib/commands/install.js +0 -1
  28. package/lib/commands/list-platforms.js +0 -1
  29. package/lib/commands/migrate.js +0 -1
  30. package/lib/commands/native-add.js +0 -5
  31. package/lib/commands/platform-clean.js +0 -1
  32. package/lib/commands/plugin/add-plugin.js +0 -1
  33. package/lib/commands/plugin/build-plugin.js +0 -1
  34. package/lib/commands/plugin/create-plugin.js +0 -5
  35. package/lib/commands/plugin/list-plugins.js +0 -1
  36. package/lib/commands/plugin/remove-plugin.js +0 -2
  37. package/lib/commands/plugin/update-plugin.js +0 -1
  38. package/lib/commands/post-install.js +0 -6
  39. package/lib/commands/prepare.js +3 -4
  40. package/lib/commands/preview.js +0 -2
  41. package/lib/commands/remove-platform.js +0 -1
  42. package/lib/commands/resources/resources-update.js +0 -2
  43. package/lib/commands/run.js +0 -1
  44. package/lib/commands/setup.js +0 -1
  45. package/lib/commands/start.js +0 -1
  46. package/lib/commands/test-init.js +0 -4
  47. package/lib/commands/test.js +2 -9
  48. package/lib/commands/typings.js +1 -2
  49. package/lib/commands/update-platform.js +0 -5
  50. package/lib/commands/update.js +0 -2
  51. package/lib/common/bootstrap.js +0 -1
  52. package/lib/common/child-process.js +0 -3
  53. package/lib/common/codeGeneration/code-entity.js +0 -1
  54. package/lib/common/codeGeneration/code-printer.js +0 -1
  55. package/lib/common/command-params.js +0 -1
  56. package/lib/common/commands/analytics.js +0 -3
  57. package/lib/common/commands/autocompletion.js +0 -3
  58. package/lib/common/commands/device/device-log-stream.js +0 -1
  59. package/lib/common/commands/device/get-file.js +0 -2
  60. package/lib/common/commands/device/list-applications.js +0 -1
  61. package/lib/common/commands/device/list-devices.js +0 -3
  62. package/lib/common/commands/device/list-files.js +0 -2
  63. package/lib/common/commands/device/put-file.js +0 -2
  64. package/lib/common/commands/device/run-application.js +0 -1
  65. package/lib/common/commands/device/stop-application.js +0 -1
  66. package/lib/common/commands/device/uninstall-application.js +0 -1
  67. package/lib/common/commands/doctor.js +2 -3
  68. package/lib/common/commands/generate-messages.js +0 -1
  69. package/lib/common/commands/help.js +0 -1
  70. package/lib/common/commands/package-manager-get.js +0 -1
  71. package/lib/common/commands/package-manager-set.js +0 -1
  72. package/lib/common/commands/post-install.js +0 -1
  73. package/lib/common/commands/preuninstall.js +2 -11
  74. package/lib/common/commands/proxy/proxy-base.js +0 -4
  75. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  76. package/lib/common/commands/proxy/proxy-get.js +0 -1
  77. package/lib/common/commands/proxy/proxy-set.js +0 -1
  78. package/lib/common/common-lib.js +0 -1
  79. package/lib/common/constants.js +0 -11
  80. package/lib/common/decorators.js +0 -48
  81. package/lib/common/dispatchers.js +1 -10
  82. package/lib/common/errors.js +3 -13
  83. package/lib/common/file-system.js +2 -13
  84. package/lib/common/header.js +0 -3
  85. package/lib/common/helpers.js +3 -89
  86. package/lib/common/host-info.js +0 -4
  87. package/lib/common/http-client.js +0 -20
  88. package/lib/common/logger/appenders/cli-appender.js +0 -4
  89. package/lib/common/logger/appenders/emit-appender.js +0 -4
  90. package/lib/common/logger/layouts/cli-layout.js +0 -1
  91. package/lib/common/logger/logger.js +0 -5
  92. package/lib/common/messages/messages.js +0 -6
  93. package/lib/common/mobile/android/android-application-manager.js +1 -20
  94. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  95. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  96. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  97. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  98. package/lib/common/mobile/android/android-device.js +0 -8
  99. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  100. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  101. package/lib/common/mobile/android/android-log-filter.js +0 -4
  102. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  103. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  104. package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
  105. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  106. package/lib/common/mobile/android/logcat-helper.js +1 -14
  107. package/lib/common/mobile/application-manager-base.js +0 -6
  108. package/lib/common/mobile/device-emitter.js +0 -4
  109. package/lib/common/mobile/device-log-emitter.js +0 -1
  110. package/lib/common/mobile/device-log-provider-base.js +0 -1
  111. package/lib/common/mobile/device-log-provider.js +0 -23
  112. package/lib/common/mobile/device-platforms-constants.js +0 -1
  113. package/lib/common/mobile/emulator-helper.js +0 -3
  114. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  115. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
  116. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  117. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  118. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  119. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  120. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  121. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  122. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  123. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  124. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  125. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  126. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  127. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  128. package/lib/common/mobile/log-filter.js +0 -2
  129. package/lib/common/mobile/logging-levels.js +0 -1
  130. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  131. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  132. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  133. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  134. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  135. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  136. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  137. package/lib/common/mobile/mobile-helper.js +0 -1
  138. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  139. package/lib/common/opener.js +0 -1
  140. package/lib/common/os-info.js +0 -1
  141. package/lib/common/plist-parser.js +0 -1
  142. package/lib/common/project-helper.js +0 -1
  143. package/lib/common/prompter.js +1 -9
  144. package/lib/common/queue.js +0 -1
  145. package/lib/common/resource-loader.js +0 -1
  146. package/lib/common/services/auto-completion-service.js +1 -13
  147. package/lib/common/services/cancellation.js +1 -2
  148. package/lib/common/services/commands-service.js +6 -17
  149. package/lib/common/services/help-service.js +3 -11
  150. package/lib/common/services/hooks-service.js +0 -13
  151. package/lib/common/services/ios-notification-service.js +0 -1
  152. package/lib/common/services/json-file-settings-service.js +0 -6
  153. package/lib/common/services/lock-service.js +0 -6
  154. package/lib/common/services/message-contract-generator.js +0 -1
  155. package/lib/common/services/messages-service.js +0 -1
  156. package/lib/common/services/micro-templating-service.js +0 -6
  157. package/lib/common/services/net-service.js +0 -3
  158. package/lib/common/services/project-files-manager.js +0 -5
  159. package/lib/common/services/project-files-provider-base.js +0 -1
  160. package/lib/common/services/proxy-service.js +0 -1
  161. package/lib/common/services/qr.js +0 -1
  162. package/lib/common/services/settings-service.js +0 -1
  163. package/lib/common/services/xcode-select-service.js +0 -1
  164. package/lib/common/utils.js +0 -1
  165. package/lib/common/validators/project-name-validator.js +0 -1
  166. package/lib/common/validators/validation-result.js +0 -1
  167. package/lib/common/verify-node-version.js +1 -8
  168. package/lib/common/yok.js +11 -32
  169. package/lib/config.js +1 -22
  170. package/lib/constants-provider.js +0 -1
  171. package/lib/constants.js +0 -53
  172. package/lib/controllers/build-controller.js +3 -4
  173. package/lib/controllers/debug-controller.js +3 -8
  174. package/lib/controllers/deploy-controller.js +0 -1
  175. package/lib/controllers/migrate-controller.js +3 -91
  176. package/lib/controllers/platform-controller.js +1 -9
  177. package/lib/controllers/prepare-controller.js +9 -19
  178. package/lib/controllers/run-controller.js +1 -17
  179. package/lib/controllers/update-controller-base.js +0 -1
  180. package/lib/controllers/update-controller.js +0 -11
  181. package/lib/data/build-data.js +0 -1
  182. package/lib/data/controller-data-base.js +0 -1
  183. package/lib/data/debug-data.js +0 -1
  184. package/lib/data/platform-data.js +0 -1
  185. package/lib/data/prepare-data.js +1 -1
  186. package/lib/data/run-data.js +0 -1
  187. package/lib/declarations.d.ts +1 -1
  188. package/lib/definitions/prepare.d.ts +2 -0
  189. package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
  190. package/lib/detached-processes/cleanup-process.js +14 -18
  191. package/lib/detached-processes/file-log-service.js +1 -2
  192. package/lib/device-path-provider.js +0 -1
  193. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
  194. package/lib/device-sockets/ios/notification.js +0 -3
  195. package/lib/device-sockets/ios/socket-request-executor.js +0 -3
  196. package/lib/helpers/android-bundle-validator-helper.js +1 -2
  197. package/lib/helpers/deploy-command-helper.js +0 -1
  198. package/lib/helpers/key-command-helper.js +2 -4
  199. package/lib/helpers/livesync-command-helper.js +1 -4
  200. package/lib/helpers/network-connectivity-validator.js +0 -1
  201. package/lib/helpers/options-track-helper.js +2 -3
  202. package/lib/helpers/package-path-helper.js +0 -1
  203. package/lib/helpers/platform-command-helper.js +2 -7
  204. package/lib/helpers/version-validator-helper.js +0 -1
  205. package/lib/key-commands/bootstrap.js +2 -3
  206. package/lib/key-commands/index.js +32 -26
  207. package/lib/nativescript-cli-lib-bootstrap.js +0 -4
  208. package/lib/nativescript-cli-lib.js +0 -1
  209. package/lib/nativescript-cli.js +1 -10
  210. package/lib/node/pbxproj-dom-xcode.js +0 -1
  211. package/lib/node/xcode.js +0 -1
  212. package/lib/node-package-manager.js +1 -11
  213. package/lib/options.js +119 -143
  214. package/lib/package-installation-manager.js +1 -8
  215. package/lib/package-manager.js +0 -2
  216. package/lib/platform-command-param.js +0 -1
  217. package/lib/pnpm-package-manager.js +1 -4
  218. package/lib/project-data.js +0 -12
  219. package/lib/providers/project-files-provider.js +0 -1
  220. package/lib/resolvers/livesync-service-resolver.js +0 -1
  221. package/lib/services/analytics/analytics-broker-process.js +6 -10
  222. package/lib/services/analytics/analytics-broker.js +1 -2
  223. package/lib/services/analytics/analytics-service.js +25 -29
  224. package/lib/services/analytics/google-analytics-provider.js +12 -13
  225. package/lib/services/analytics-settings-service.js +0 -5
  226. package/lib/services/android/android-bundle-tool-service.js +0 -1
  227. package/lib/services/android/gradle-build-args-service.js +0 -3
  228. package/lib/services/android/gradle-build-service.js +0 -1
  229. package/lib/services/android/gradle-command-service.js +0 -1
  230. package/lib/services/android-device-debug-service.js +0 -6
  231. package/lib/services/android-plugin-build-service.js +0 -29
  232. package/lib/services/android-project-service.js +4 -71
  233. package/lib/services/android-resources-migration-service.js +0 -7
  234. package/lib/services/apple-portal/apple-portal-application-service.js +1 -2
  235. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  236. package/lib/services/apple-portal/apple-portal-session-service.js +42 -15
  237. package/lib/services/apple-portal/srp/srp-wrapper.js +76 -0
  238. package/lib/services/assets-generation/assets-generation-service.js +5 -16
  239. package/lib/services/build-artifacts-service.js +1 -2
  240. package/lib/services/build-data-service.js +0 -1
  241. package/lib/services/build-info-file-service.js +0 -1
  242. package/lib/services/cleanup-service.js +9 -13
  243. package/lib/services/cocoapods-platform-manager.js +0 -9
  244. package/lib/services/cocoapods-service.js +1 -21
  245. package/lib/services/debug-data-service.js +0 -1
  246. package/lib/services/debug-service-base.js +0 -7
  247. package/lib/services/device/device-install-app-service.js +1 -2
  248. package/lib/services/doctor-service.js +6 -21
  249. package/lib/services/extensibility-service.js +0 -8
  250. package/lib/services/files-hash-service.js +0 -1
  251. package/lib/services/hmr-status-service.js +0 -2
  252. package/lib/services/info-service.js +0 -1
  253. package/lib/services/initialize-service.js +1 -5
  254. package/lib/services/ios/export-options-plist-service.js +4 -6
  255. package/lib/services/ios/ios-signing-service.js +45 -27
  256. package/lib/services/ios/spm-service.js +0 -9
  257. package/lib/services/ios/xcodebuild-args-service.js +0 -9
  258. package/lib/services/ios/xcodebuild-command-service.js +0 -1
  259. package/lib/services/ios/xcodebuild-service.js +2 -1
  260. package/lib/services/ios-debugger-port-service.js +0 -1
  261. package/lib/services/ios-device-debug-service.js +0 -1
  262. package/lib/services/ios-entitlements-service.js +0 -1
  263. package/lib/services/ios-extensions-service.js +0 -1
  264. package/lib/services/ios-log-filter.js +0 -20
  265. package/lib/services/ios-native-target-service.js +4 -6
  266. package/lib/services/ios-project-service.js +2 -94
  267. package/lib/services/ios-provision-service.js +0 -3
  268. package/lib/services/ios-watch-app-service.js +0 -1
  269. package/lib/services/ip-service.js +0 -2
  270. package/lib/services/itmstransporter-service.js +0 -1
  271. package/lib/services/karma-execution.js +0 -2
  272. package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
  273. package/lib/services/livesync/android-device-livesync-service.js +0 -2
  274. package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
  275. package/lib/services/livesync/android-livesync-service.js +0 -1
  276. package/lib/services/livesync/android-livesync-tool.js +0 -4
  277. package/lib/services/livesync/device-livesync-service-base.js +0 -2
  278. package/lib/services/livesync/ios-device-livesync-service.js +0 -7
  279. package/lib/services/livesync/ios-livesync-service.js +0 -2
  280. package/lib/services/livesync/livesync-socket.js +0 -1
  281. package/lib/services/livesync/platform-livesync-service-base.js +0 -5
  282. package/lib/services/livesync-process-data-service.js +0 -1
  283. package/lib/services/log-parser-service.js +0 -1
  284. package/lib/services/log-source-map-service.js +0 -15
  285. package/lib/services/marking-mode-service.js +5 -8
  286. package/lib/services/metadata-filtering-service.js +0 -1
  287. package/lib/services/npm-config-service.js +0 -4
  288. package/lib/services/pacote-service.js +0 -7
  289. package/lib/services/performance-service.js +1 -3
  290. package/lib/services/platform/add-platform-service.js +2 -49
  291. package/lib/services/platform/platform-validation-service.js +0 -1
  292. package/lib/services/platform/prepare-native-platform-service.js +2 -5
  293. package/lib/services/platform-environment-requirements.js +3 -8
  294. package/lib/services/platform-project-service-base.js +0 -1
  295. package/lib/services/platforms-data-service.js +0 -1
  296. package/lib/services/plugins-service.js +2 -20
  297. package/lib/services/prepare-data-service.js +0 -1
  298. package/lib/services/project-backup-service.js +0 -4
  299. package/lib/services/project-changes-service.js +3 -14
  300. package/lib/services/project-cleanup-service.js +0 -2
  301. package/lib/services/project-config-service.js +2 -22
  302. package/lib/services/project-data-service.js +7 -36
  303. package/lib/services/project-name-service.js +0 -1
  304. package/lib/services/project-service.js +0 -10
  305. package/lib/services/project-templates-service.js +2 -3
  306. package/lib/services/qr-code-terminal-service.js +0 -1
  307. package/lib/services/require-service.js +0 -1
  308. package/lib/services/start-service.js +0 -1
  309. package/lib/services/temp-service.js +0 -1
  310. package/lib/services/terminal-spinner-service.js +0 -2
  311. package/lib/services/test-execution-service.js +2 -9
  312. package/lib/services/test-initialization-service.js +0 -4
  313. package/lib/services/timeline-profiler-service.js +0 -1
  314. package/lib/services/user-settings-service.js +0 -1
  315. package/lib/services/versions-service.js +4 -6
  316. package/lib/services/watch-ignore-list-service.js +0 -1
  317. package/lib/services/webpack/webpack-compiler-service.js +9 -44
  318. package/lib/services/xcconfig-service.js +0 -2
  319. package/lib/services/xcproj-service.js +0 -1
  320. package/lib/shared-event-bus.js +0 -6
  321. package/lib/sys-info.js +1 -2
  322. package/lib/tools/config-manipulation/config-transformer.js +0 -12
  323. package/lib/tools/node-modules/node-modules-builder.js +0 -1
  324. package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
  325. package/lib/yarn-package-manager.js +0 -1
  326. package/lib/yarn2-package-manager.js +0 -3
  327. package/package.json +4 -3
@@ -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
@@ -20,4 +20,3 @@ class DevicePlatformsConstants {
20
20
  }
21
21
  exports.DevicePlatformsConstants = DevicePlatformsConstants;
22
22
  yok_1.injector.register("devicePlatformsConstants", DevicePlatformsConstants);
23
- //# sourceMappingURL=device-platforms-constants.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-35": "15.0.0",
12
11
  "android-34": "14.0.0",
@@ -80,9 +79,7 @@ class EmulatorHelper {
80
79
  emulator.identifier = emulatorId;
81
80
  emulator.status = constants_1.RUNNING_EMULATOR_STATUS;
82
81
  emulator.type = constants_1.DeviceTypes.Device;
83
- //emulator.isTablet; // TODO: consider to do this here!!!
84
82
  }
85
83
  }
86
84
  exports.EmulatorHelper = EmulatorHelper;
87
85
  yok_1.injector.register("emulatorHelper", EmulatorHelper);
88
- //# 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
@@ -131,4 +131,3 @@ class IOSDeviceFileSystem {
131
131
  }
132
132
  IOSDeviceFileSystem.AFC_DELETE_FILE_NOT_FOUND_ERROR = 8;
133
133
  exports.IOSDeviceFileSystem = IOSDeviceFileSystem;
134
- //# sourceMappingURL=ios-device-file-system.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
@@ -106,4 +106,3 @@ __decorate([
106
106
  (0, decorators_1.performanceLog)()
107
107
  ], IOSDeviceBase.prototype, "getDebugSocket", null);
108
108
  exports.IOSDeviceBase = IOSDeviceBase;
109
- //# sourceMappingURL=ios-device-base.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
@@ -22,4 +22,3 @@ class IOSLogFilter {
22
22
  }
23
23
  exports.IOSLogFilter = IOSLogFilter;
24
24
  yok_1.injector.register("iOSLogFilter", IOSLogFilter);
25
- //# sourceMappingURL=ios-log-filter.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
@@ -79,4 +79,3 @@ class IOSSimulatorFileSystem {
79
79
  }
80
80
  }
81
81
  exports.IOSSimulatorFileSystem = IOSSimulatorFileSystem;
82
- //# sourceMappingURL=ios-simulator-file-system.js.map
@@ -67,4 +67,3 @@ class IOSSimulatorLogProvider extends events_1.EventEmitter {
67
67
  }
68
68
  exports.IOSSimulatorLogProvider = IOSSimulatorLogProvider;
69
69
  yok_1.injector.register("iOSSimulatorLogProvider", IOSSimulatorLogProvider);
70
- //# sourceMappingURL=ios-simulator-log-provider.js.map
@@ -35,4 +35,3 @@ class LocalToDevicePathDataFactory {
35
35
  }
36
36
  exports.LocalToDevicePathDataFactory = LocalToDevicePathDataFactory;
37
37
  yok_1.injector.register("localToDevicePathDataFactory", LocalToDevicePathDataFactory);
38
- //# sourceMappingURL=local-to-device-path-data-factory.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
@@ -10,4 +10,3 @@ class LoggingLevels {
10
10
  }
11
11
  exports.LoggingLevels = LoggingLevels;
12
12
  yok_1.injector.register("loggingLevels", LoggingLevels);
13
- //# sourceMappingURL=logging-levels.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
@@ -62,4 +62,3 @@ class DeviceDiscovery extends events_1.EventEmitter {
62
62
  }
63
63
  exports.DeviceDiscovery = DeviceDiscovery;
64
64
  yok_1.injector.register("deviceDiscovery", DeviceDiscovery);
65
- //# sourceMappingURL=device-discovery.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