@expo/cli 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/build/bin/cli +2 -2
  2. package/build/src/api/getExpoGoIntermediateCertificate.js +1 -1
  3. package/build/src/api/getExpoGoIntermediateCertificate.js.map +1 -1
  4. package/build/src/api/getExpoSchema.js +1 -1
  5. package/build/src/api/getExpoSchema.js.map +1 -1
  6. package/build/src/api/getNativeModuleVersions.js +1 -1
  7. package/build/src/api/getNativeModuleVersions.js.map +1 -1
  8. package/build/src/api/getProjectDevelopmentCertificate.js +1 -1
  9. package/build/src/api/getProjectDevelopmentCertificate.js.map +1 -1
  10. package/build/src/api/getVersions.js +1 -1
  11. package/build/src/api/getVersions.js.map +1 -1
  12. package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -1
  13. package/build/src/api/rest/client.js +5 -5
  14. package/build/src/api/rest/client.js.map +1 -1
  15. package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
  16. package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
  17. package/build/src/api/rest/wrapFetchWithProxy.js.map +1 -1
  18. package/build/src/api/updateDevelopmentSession.js +1 -1
  19. package/build/src/api/updateDevelopmentSession.js.map +1 -1
  20. package/build/src/api/user/actions.js +2 -2
  21. package/build/src/api/user/actions.js.map +1 -1
  22. package/build/src/api/user/otp.js +1 -1
  23. package/build/src/api/user/otp.js.map +1 -1
  24. package/build/src/api/user/user.js +2 -2
  25. package/build/src/api/user/user.js.map +1 -1
  26. package/build/src/config/configAsync.js +17 -1
  27. package/build/src/config/configAsync.js.map +1 -1
  28. package/build/src/customize/customizeAsync.js +1 -1
  29. package/build/src/customize/customizeAsync.js.map +1 -1
  30. package/build/src/customize/generate.js +29 -2
  31. package/build/src/customize/generate.js.map +1 -1
  32. package/build/src/customize/templates.js +8 -0
  33. package/build/src/customize/templates.js.map +1 -1
  34. package/build/src/customize/typescript.js +54 -0
  35. package/build/src/customize/typescript.js.map +1 -0
  36. package/build/src/export/createBundles.js +1 -1
  37. package/build/src/export/createBundles.js.map +1 -1
  38. package/build/src/export/createMetadataJson.js.map +1 -1
  39. package/build/src/export/embed/exportEmbedAsync.js +50 -4
  40. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  41. package/build/src/export/embed/index.js +1 -3
  42. package/build/src/export/embed/index.js.map +1 -1
  43. package/build/src/export/embed/resolveOptions.js +6 -10
  44. package/build/src/export/embed/resolveOptions.js.map +1 -1
  45. package/build/src/export/exportApp.js +50 -41
  46. package/build/src/export/exportApp.js.map +1 -1
  47. package/build/src/export/exportAssets.js +2 -2
  48. package/build/src/export/exportAssets.js.map +1 -1
  49. package/build/src/export/exportAsync.js +1 -1
  50. package/build/src/export/exportAsync.js.map +1 -1
  51. package/build/src/export/exportStaticAsync.js +42 -12
  52. package/build/src/export/exportStaticAsync.js.map +1 -1
  53. package/build/src/export/fork-bundleAsync.js +27 -2
  54. package/build/src/export/fork-bundleAsync.js.map +1 -1
  55. package/build/src/export/getPublicExpoManifest.js +1 -1
  56. package/build/src/export/getPublicExpoManifest.js.map +1 -1
  57. package/build/src/export/getResolvedLocales.js.map +1 -1
  58. package/build/src/export/printBundleSizes.js.map +1 -1
  59. package/build/src/export/web/exportWebAsync.js.map +1 -1
  60. package/build/src/export/writeContents.js +5 -1
  61. package/build/src/export/writeContents.js.map +1 -1
  62. package/build/src/install/checkPackages.js +1 -1
  63. package/build/src/install/checkPackages.js.map +1 -1
  64. package/build/src/install/installAsync.js +1 -1
  65. package/build/src/install/installAsync.js.map +1 -1
  66. package/build/src/prebuild/configureProjectAsync.js +5 -9
  67. package/build/src/prebuild/configureProjectAsync.js.map +1 -1
  68. package/build/src/prebuild/prebuildAsync.js +5 -5
  69. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  70. package/build/src/prebuild/updateFromTemplate.js +8 -5
  71. package/build/src/prebuild/updateFromTemplate.js.map +1 -1
  72. package/build/src/register/registerAsync.js +0 -1
  73. package/build/src/register/registerAsync.js.map +1 -1
  74. package/build/src/run/android/resolveInstallApkName.js.map +1 -1
  75. package/build/src/run/android/resolveOptions.js +1 -1
  76. package/build/src/run/android/resolveOptions.js.map +1 -1
  77. package/build/src/run/android/runAndroidAsync.js +2 -2
  78. package/build/src/run/android/runAndroidAsync.js.map +1 -1
  79. package/build/src/run/ios/XcodeBuild.js +2 -2
  80. package/build/src/run/ios/XcodeBuild.js.map +1 -1
  81. package/build/src/run/ios/appleDevice/AppleDevice.js +4 -4
  82. package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
  83. package/build/src/run/ios/appleDevice/ClientManager.js +1 -1
  84. package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
  85. package/build/src/run/ios/appleDevice/client/AFCClient.js +1 -1
  86. package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
  87. package/build/src/run/ios/appleDevice/client/DebugserverClient.js +1 -1
  88. package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
  89. package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +1 -1
  90. package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
  91. package/build/src/run/ios/appleDevice/client/LockdowndClient.js +1 -1
  92. package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
  93. package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js +1 -1
  94. package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
  95. package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -1
  96. package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +1 -1
  97. package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
  98. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +1 -1
  99. package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
  100. package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +1 -1
  101. package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
  102. package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
  103. package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +1 -1
  104. package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
  105. package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +1 -1
  106. package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
  107. package/build/src/run/ios/codeSigning/configureCodeSigning.js +1 -1
  108. package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
  109. package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +2 -2
  110. package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
  111. package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +3 -0
  112. package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
  113. package/build/src/run/ios/index.js.map +1 -1
  114. package/build/src/run/ios/launchApp.js +2 -2
  115. package/build/src/run/ios/launchApp.js.map +1 -1
  116. package/build/src/run/ios/options/resolveDevice.js +1 -1
  117. package/build/src/run/ios/options/resolveDevice.js.map +1 -1
  118. package/build/src/run/ios/options/resolveOptions.js +2 -2
  119. package/build/src/run/ios/options/resolveOptions.js.map +1 -1
  120. package/build/src/run/ios/runIosAsync.js +3 -3
  121. package/build/src/run/ios/runIosAsync.js.map +1 -1
  122. package/build/src/start/doctor/apple/XcodePrerequisite.js +43 -2
  123. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  124. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +1 -1
  125. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  126. package/build/src/start/doctor/dependencies/getVersionedPackages.js +5 -3
  127. package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
  128. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +1 -1
  129. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
  130. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  131. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +7 -7
  132. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
  133. package/build/src/start/doctor/typescript/updateTSConfig.js +11 -10
  134. package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
  135. package/build/src/start/index.js +0 -2
  136. package/build/src/start/index.js.map +1 -1
  137. package/build/src/start/interface/interactiveActions.js +1 -1
  138. package/build/src/start/interface/interactiveActions.js.map +1 -1
  139. package/build/src/start/interface/startInterface.js +3 -3
  140. package/build/src/start/interface/startInterface.js.map +1 -1
  141. package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
  142. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  143. package/build/src/start/platforms/android/ADBServer.js +1 -1
  144. package/build/src/start/platforms/android/ADBServer.js.map +1 -1
  145. package/build/src/start/platforms/android/AndroidDeviceManager.js +5 -5
  146. package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
  147. package/build/src/start/platforms/android/AndroidPlatformManager.js +1 -1
  148. package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
  149. package/build/src/start/platforms/android/adb.js +1 -1
  150. package/build/src/start/platforms/android/adb.js.map +1 -1
  151. package/build/src/start/platforms/android/adbReverse.js +2 -2
  152. package/build/src/start/platforms/android/adbReverse.js.map +1 -1
  153. package/build/src/start/platforms/android/emulator.js +1 -1
  154. package/build/src/start/platforms/android/emulator.js.map +1 -1
  155. package/build/src/start/platforms/android/getDevices.js +1 -1
  156. package/build/src/start/platforms/android/getDevices.js.map +1 -1
  157. package/build/src/start/platforms/android/promptAndroidDevice.js +1 -1
  158. package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
  159. package/build/src/start/platforms/ios/AppleDeviceManager.js +5 -5
  160. package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
  161. package/build/src/start/platforms/ios/ApplePlatformManager.js +1 -1
  162. package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
  163. package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
  164. package/build/src/start/platforms/ios/getBestSimulator.js +1 -1
  165. package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
  166. package/build/src/start/platforms/ios/promptAppleDevice.js +1 -1
  167. package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
  168. package/build/src/start/platforms/ios/simctl.js +1 -1
  169. package/build/src/start/platforms/ios/simctl.js.map +1 -1
  170. package/build/src/start/platforms/ios/simctlLogging.js +1 -1
  171. package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
  172. package/build/src/start/resolveOptions.js +0 -5
  173. package/build/src/start/resolveOptions.js.map +1 -1
  174. package/build/src/start/server/AsyncNgrok.js +4 -3
  175. package/build/src/start/server/AsyncNgrok.js.map +1 -1
  176. package/build/src/start/server/BundlerDevServer.js +4 -11
  177. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  178. package/build/src/start/server/DevServerManager.js +3 -2
  179. package/build/src/start/server/DevServerManager.js.map +1 -1
  180. package/build/src/start/server/UrlCreator.js +2 -1
  181. package/build/src/start/server/UrlCreator.js.map +1 -1
  182. package/build/src/start/server/getStaticRenderFunctions.js +2 -2
  183. package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
  184. package/build/src/start/server/metro/MetroBundlerDevServer.js +42 -25
  185. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  186. package/build/src/start/server/metro/MetroTerminalReporter.js +14 -3
  187. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  188. package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
  189. package/build/src/start/server/metro/TerminalReporter.types.js.map +1 -1
  190. package/build/src/start/server/metro/inspector-proxy/device.js.map +1 -1
  191. package/build/src/start/server/metro/inspector-proxy/handlers/NetworkResponse.js.map +1 -1
  192. package/build/src/start/server/metro/inspector-proxy/handlers/PageReload.js.map +1 -1
  193. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -1
  194. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerScriptParsed.js.map +1 -1
  195. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -1
  196. package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeGetProperties.js.map +1 -1
  197. package/build/src/start/server/metro/inspector-proxy/handlers/types.js.map +1 -1
  198. package/build/src/start/server/metro/inspector-proxy/index.js +1 -1
  199. package/build/src/start/server/metro/inspector-proxy/index.js.map +1 -1
  200. package/build/src/start/server/metro/instantiateMetro.js +49 -8
  201. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  202. package/build/src/start/server/metro/resolveFromProject.js +0 -4
  203. package/build/src/start/server/metro/resolveFromProject.js.map +1 -1
  204. package/build/src/start/server/metro/runServer-fork.js +1 -1
  205. package/build/src/start/server/metro/runServer-fork.js.map +1 -1
  206. package/build/src/start/server/metro/withMetroMultiPlatform.js +59 -9
  207. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
  208. package/build/src/start/server/metro/withMetroResolvers.js +6 -5
  209. package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
  210. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +2 -2
  211. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
  212. package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
  213. package/build/src/start/server/middleware/FaviconMiddleware.js +1 -1
  214. package/build/src/start/server/middleware/FaviconMiddleware.js.map +1 -1
  215. package/build/src/start/server/middleware/ManifestMiddleware.js +8 -11
  216. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  217. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +1 -1
  218. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
  219. package/build/src/start/server/middleware/ServeStaticMiddleware.js +1 -1
  220. package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
  221. package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
  222. package/build/src/start/server/middleware/server.types.js.map +1 -1
  223. package/build/src/start/server/openPlatforms.js.map +1 -1
  224. package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
  225. package/build/src/start/server/type-generation/routes.js +6 -6
  226. package/build/src/start/server/type-generation/routes.js.map +1 -1
  227. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +3 -3
  228. package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
  229. package/build/src/start/server/webpack/WebpackBundlerDevServer.js +10 -5
  230. package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
  231. package/build/src/start/server/webpack/compile.js +1 -1
  232. package/build/src/start/server/webpack/compile.js.map +1 -1
  233. package/build/src/start/startAsync.js +10 -32
  234. package/build/src/start/startAsync.js.map +1 -1
  235. package/build/src/utils/FileNotifier.js +1 -1
  236. package/build/src/utils/FileNotifier.js.map +1 -1
  237. package/build/src/utils/analytics/metroDebuggerMiddleware.js +1 -1
  238. package/build/src/utils/analytics/metroDebuggerMiddleware.js.map +1 -1
  239. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  240. package/build/src/utils/array.js.map +1 -1
  241. package/build/src/utils/cocoapods.js +2 -2
  242. package/build/src/utils/cocoapods.js.map +1 -1
  243. package/build/src/utils/codesigning.js +2 -2
  244. package/build/src/utils/codesigning.js.map +1 -1
  245. package/build/src/utils/downloadAppAsync.js +1 -1
  246. package/build/src/utils/downloadAppAsync.js.map +1 -1
  247. package/build/src/utils/downloadExpoGoAsync.js +2 -2
  248. package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
  249. package/build/src/utils/editor.js +1 -1
  250. package/build/src/utils/editor.js.map +1 -1
  251. package/build/src/utils/env.js +1 -1
  252. package/build/src/utils/env.js.map +1 -1
  253. package/build/src/utils/errors.js.map +1 -1
  254. package/build/src/utils/getOrPromptApplicationId.js +2 -2
  255. package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
  256. package/build/src/utils/git.js +1 -1
  257. package/build/src/utils/git.js.map +1 -1
  258. package/build/src/utils/modifyConfigAsync.js +1 -1
  259. package/build/src/utils/modifyConfigAsync.js.map +1 -1
  260. package/build/src/utils/modifyConfigPlugins.js +1 -1
  261. package/build/src/utils/modifyConfigPlugins.js.map +1 -1
  262. package/build/src/utils/npm.js +1 -1
  263. package/build/src/utils/npm.js.map +1 -1
  264. package/build/src/utils/obj.js.map +1 -1
  265. package/build/src/utils/plist.js +1 -1
  266. package/build/src/utils/plist.js.map +1 -1
  267. package/build/src/utils/port.js +1 -1
  268. package/build/src/utils/port.js.map +1 -1
  269. package/build/src/utils/profile.js +1 -1
  270. package/build/src/utils/profile.js.map +1 -1
  271. package/build/src/utils/scheme.js +1 -1
  272. package/build/src/utils/scheme.js.map +1 -1
  273. package/build/src/utils/tsconfig/loadTsConfigPaths.js +1 -1
  274. package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
  275. package/build/src/utils/validateApplicationId.js +85 -5
  276. package/build/src/utils/validateApplicationId.js.map +1 -1
  277. package/package.json +11 -8
  278. package/build/src/api/signManifest.js +0 -26
  279. package/build/src/api/signManifest.js.map +0 -1
  280. package/build/src/start/server/middleware/ClassicManifestMiddleware.js +0 -155
  281. package/build/src/start/server/middleware/ClassicManifestMiddleware.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/run/ios/appleDevice/protocol/LockdownProtocol.ts"],"sourcesContent":["/**\n * Copyright (c) 2021 Expo, Inc.\n * Copyright (c) 2018 Drifty Co.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport plist from '@expo/plist';\nimport Debug from 'debug';\nimport { Socket } from 'net';\n\nimport { CommandError } from '../../../../utils/errors';\nimport type { ProtocolWriter } from './AbstractProtocol';\nimport { PlistProtocolReader, ProtocolClient, ProtocolReaderFactory } from './AbstractProtocol';\n\nconst debug = Debug('expo:apple-device:protocol:lockdown');\nexport const LOCKDOWN_HEADER_SIZE = 4;\n\nexport interface LockdownCommand {\n Command: string;\n [key: string]: any;\n}\n\nexport interface LockdownResponse {\n Status: string;\n [key: string]: any;\n}\n\nexport interface LockdownErrorResponse {\n Error: string;\n Request?: string;\n Service?: string;\n}\n\nexport interface LockdownRequest {\n Request: string;\n [key: string]: any;\n}\n\nfunction isDefined(val: any) {\n return typeof val !== 'undefined';\n}\n\nexport function isLockdownResponse(resp: any): resp is LockdownResponse {\n return isDefined(resp.Status);\n}\n\nexport function isLockdownErrorResponse(resp: any): resp is LockdownErrorResponse {\n return isDefined(resp.Error);\n}\n\nexport class LockdownProtocolClient<\n MessageType extends LockdownRequest | LockdownCommand = LockdownRequest\n> extends ProtocolClient<MessageType> {\n constructor(socket: Socket) {\n super(socket, new ProtocolReaderFactory(LockdownProtocolReader), new LockdownProtocolWriter());\n }\n}\n\nexport class LockdownProtocolReader extends PlistProtocolReader {\n constructor(callback: (data: any) => any) {\n super(LOCKDOWN_HEADER_SIZE, callback);\n }\n\n parseHeader(data: Buffer) {\n return data.readUInt32BE(0);\n }\n\n parseBody(data: Buffer) {\n const resp = super.parseBody(data);\n debug(`Response: ${JSON.stringify(resp)}`);\n if (isLockdownErrorResponse(resp)) {\n if (resp.Error === 'DeviceLocked') {\n throw new CommandError('APPLE_DEVICE_LOCKED', 'Device is currently locked.');\n }\n\n if (resp.Error === 'InvalidService') {\n let errorMessage = `${resp.Error}: ${resp.Service} (request: ${resp.Request})`;\n if (resp.Service === 'com.apple.debugserver') {\n errorMessage +=\n '\\nTry reconnecting your device. You can also debug service logs with `export DEBUG=expo:xdl:ios:*`';\n }\n throw new CommandError('APPLE_DEVICE_LOCKDOWN', errorMessage);\n }\n\n throw new CommandError('APPLE_DEVICE_LOCKDOWN', resp.Error);\n }\n return resp;\n }\n}\n\nexport class LockdownProtocolWriter implements ProtocolWriter {\n write(socket: Socket, plistData: any) {\n debug(`socket write: ${JSON.stringify(plistData)}`);\n const plistMessage = plist.build(plistData);\n const header = Buffer.alloc(LOCKDOWN_HEADER_SIZE);\n header.writeUInt32BE(plistMessage.length, 0);\n socket.write(header);\n socket.write(plistMessage);\n }\n}\n"],"names":["isLockdownResponse","isLockdownErrorResponse","debug","Debug","LOCKDOWN_HEADER_SIZE","isDefined","val","resp","Status","Error","LockdownProtocolClient","ProtocolClient","constructor","socket","ProtocolReaderFactory","LockdownProtocolReader","LockdownProtocolWriter","PlistProtocolReader","callback","parseHeader","data","readUInt32BE","parseBody","JSON","stringify","CommandError","errorMessage","Service","Request","write","plistData","plistMessage","plist","build","header","Buffer","alloc","writeUInt32BE","length"],"mappings":"AAQA;;;;QAoCgBA,kBAAkB,GAAlBA,kBAAkB;QAIlBC,uBAAuB,GAAvBA,uBAAuB;;AAxCrB,IAAA,MAAa,kCAAb,aAAa,EAAA;AACb,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGI,IAAA,OAA0B,WAA1B,0BAA0B,CAAA;AAEoB,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;;;;;;AAE/F,MAAMC,KAAK,GAAGC,CAAAA,GAAAA,MAAK,AAAuC,CAAA,QAAvC,CAAC,qCAAqC,CAAC,AAAC;AACpD,MAAMC,oBAAoB,GAAG,CAAC,AAAC;QAAzBA,oBAAoB,GAApBA,oBAAoB;AAuBjC,SAASC,SAAS,CAACC,GAAQ,EAAE;IAC3B,OAAO,OAAOA,GAAG,KAAK,WAAW,CAAC;CACnC;AAEM,SAASN,kBAAkB,CAACO,IAAS,EAA4B;IACtE,OAAOF,SAAS,CAACE,IAAI,CAACC,MAAM,CAAC,CAAC;CAC/B;AAEM,SAASP,uBAAuB,CAACM,IAAS,EAAiC;IAChF,OAAOF,SAAS,CAACE,IAAI,CAACE,KAAK,CAAC,CAAC;CAC9B;AAEM,MAAMC,sBAAsB,SAEzBC,iBAAc,eAAA;IACt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AACE,KAAK,CAAC,CAAC;SAC7D;QACD,OAAOF,IAAI,CAAC;KACb;CACF;QA9BYQ,sBAAsB,GAAtBA,sBAAsB;AAgC5B,MAAMC,sBAAsB;IACjCa,KAAK,CAAChB,MAAc,EAAEiB,SAAc,EAAE;QACpC5B,KAAK,CAAC,CAAC,cAAc,EAAEqB,IAAI,CAACC,SAAS,CAACM,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,MAAMC,YAAY,GAAGC,MAAK,QAAA,CAACC,KAAK,CAACH,SAAS,CAAC,AAAC;QAC5C,MAAMI,MAAM,GAAGC,MAAM,CAACC,KAAK,CAAChC,oBAAoB,CAAC,AAAC;QAClD8B,MAAM,CAACG,aAAa,CAACN,YAAY,CAACO,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7CzB,MAAM,CAACgB,KAAK,CAACK,MAAM,CAAC,CAAC;QACrBrB,MAAM,CAACgB,KAAK,CAACE,YAAY,CAAC,CAAC;KAC5B;CACF;QATYf,sBAAsB,GAAtBA,sBAAsB"}
1
+ {"version":3,"sources":["../../../../../../src/run/ios/appleDevice/protocol/LockdownProtocol.ts"],"sourcesContent":["/**\n * Copyright (c) 2021 Expo, Inc.\n * Copyright (c) 2018 Drifty Co.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport plist from '@expo/plist';\nimport Debug from 'debug';\nimport { Socket } from 'net';\n\nimport type { ProtocolWriter } from './AbstractProtocol';\nimport { PlistProtocolReader, ProtocolClient, ProtocolReaderFactory } from './AbstractProtocol';\nimport { CommandError } from '../../../../utils/errors';\n\nconst debug = Debug('expo:apple-device:protocol:lockdown');\nexport const LOCKDOWN_HEADER_SIZE = 4;\n\nexport interface LockdownCommand {\n Command: string;\n [key: string]: any;\n}\n\nexport interface LockdownResponse {\n Status: string;\n [key: string]: any;\n}\n\nexport interface LockdownErrorResponse {\n Error: string;\n Request?: string;\n Service?: string;\n}\n\nexport interface LockdownRequest {\n Request: string;\n [key: string]: any;\n}\n\nfunction isDefined(val: any) {\n return typeof val !== 'undefined';\n}\n\nexport function isLockdownResponse(resp: any): resp is LockdownResponse {\n return isDefined(resp.Status);\n}\n\nexport function isLockdownErrorResponse(resp: any): resp is LockdownErrorResponse {\n return isDefined(resp.Error);\n}\n\nexport class LockdownProtocolClient<\n MessageType extends LockdownRequest | LockdownCommand = LockdownRequest,\n> extends ProtocolClient<MessageType> {\n constructor(socket: Socket) {\n super(socket, new ProtocolReaderFactory(LockdownProtocolReader), new LockdownProtocolWriter());\n }\n}\n\nexport class LockdownProtocolReader extends PlistProtocolReader {\n constructor(callback: (data: any) => any) {\n super(LOCKDOWN_HEADER_SIZE, callback);\n }\n\n parseHeader(data: Buffer) {\n return data.readUInt32BE(0);\n }\n\n parseBody(data: Buffer) {\n const resp = super.parseBody(data);\n debug(`Response: ${JSON.stringify(resp)}`);\n if (isLockdownErrorResponse(resp)) {\n if (resp.Error === 'DeviceLocked') {\n throw new CommandError('APPLE_DEVICE_LOCKED', 'Device is currently locked.');\n }\n\n if (resp.Error === 'InvalidService') {\n let errorMessage = `${resp.Error}: ${resp.Service} (request: ${resp.Request})`;\n if (resp.Service === 'com.apple.debugserver') {\n errorMessage +=\n '\\nTry reconnecting your device. You can also debug service logs with `export DEBUG=expo:xdl:ios:*`';\n }\n throw new CommandError('APPLE_DEVICE_LOCKDOWN', errorMessage);\n }\n\n throw new CommandError('APPLE_DEVICE_LOCKDOWN', resp.Error);\n }\n return resp;\n }\n}\n\nexport class LockdownProtocolWriter implements ProtocolWriter {\n write(socket: Socket, plistData: any) {\n debug(`socket write: ${JSON.stringify(plistData)}`);\n const plistMessage = plist.build(plistData);\n const header = Buffer.alloc(LOCKDOWN_HEADER_SIZE);\n header.writeUInt32BE(plistMessage.length, 0);\n socket.write(header);\n socket.write(plistMessage);\n }\n}\n"],"names":["isLockdownResponse","isLockdownErrorResponse","debug","Debug","LOCKDOWN_HEADER_SIZE","isDefined","val","resp","Status","Error","LockdownProtocolClient","ProtocolClient","constructor","socket","ProtocolReaderFactory","LockdownProtocolReader","LockdownProtocolWriter","PlistProtocolReader","callback","parseHeader","data","readUInt32BE","parseBody","JSON","stringify","CommandError","errorMessage","Service","Request","write","plistData","plistMessage","plist","build","header","Buffer","alloc","writeUInt32BE","length"],"mappings":"AAQA;;;;QAoCgBA,kBAAkB,GAAlBA,kBAAkB;QAIlBC,uBAAuB,GAAvBA,uBAAuB;;AAxCrB,IAAA,MAAa,kCAAb,aAAa,EAAA;AACb,IAAA,MAAO,kCAAP,OAAO,EAAA;AAIkD,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AAClE,IAAA,OAA0B,WAA1B,0BAA0B,CAAA;;;;;;AAEvD,MAAMC,KAAK,GAAGC,CAAAA,GAAAA,MAAK,AAAuC,CAAA,QAAvC,CAAC,qCAAqC,CAAC,AAAC;AACpD,MAAMC,oBAAoB,GAAG,CAAC,AAAC;QAAzBA,oBAAoB,GAApBA,oBAAoB;AAuBjC,SAASC,SAAS,CAACC,GAAQ,EAAE;IAC3B,OAAO,OAAOA,GAAG,KAAK,WAAW,CAAC;CACnC;AAEM,SAASN,kBAAkB,CAACO,IAAS,EAA4B;IACtE,OAAOF,SAAS,CAACE,IAAI,CAACC,MAAM,CAAC,CAAC;CAC/B;AAEM,SAASP,uBAAuB,CAACM,IAAS,EAAiC;IAChF,OAAOF,SAAS,CAACE,IAAI,CAACE,KAAK,CAAC,CAAC;CAC9B;AAEM,MAAMC,sBAAsB,SAEzBC,iBAAc,eAAA;IACtBC,YAAYC,MAAc,CAAE;QAC1B,KAAK,CAACA,MAAM,EAAE,IAAIC,iBAAqB,sBAAA,CAACC,sBAAsB,CAAC,EAAE,IAAIC,sBAAsB,EAAE,CAAC,CAAC;KAChG;CACF;QANYN,sBAAsB,GAAtBA,sBAAsB;AAQ5B,MAAMK,sBAAsB,SAASE,iBAAmB,oBAAA;IAC7DL,YAAYM,QAA4B,CAAE;QACxC,KAAK,CAACd,oBAAoB,EAAEc,Q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,GAAGC,MAAK,QAAA,CAACC,KAAK,CAACH,SAAS,CAAC,AAAC;QAC5C,MAAMI,MAAM,GAAGC,MAAM,CAACC,KAAK,CAAChC,oBAAoB,CAAC,AAAC;QAClD8B,MAAM,CAACG,aAAa,CAACN,YAAY,CAACO,MAAM,EAAE,CAAC,CAAC,CAAC;QAC7CzB,MAAM,CAACgB,KAAK,CAACK,MAAM,CAAC,CAAC;QACrBrB,MAAM,CAACgB,KAAK,CAACE,YAAY,CAAC,CAAC;KAC5B;CACF;QATYf,sBAAsB,GAAtBA,sBAAsB"}
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  exports.ensureDeviceIsCodeSignedForDeploymentAsync = ensureDeviceIsCodeSignedForDeploymentAsync;
6
6
  var _chalk = _interopRequireDefault(require("chalk"));
7
- var Log = _interopRequireWildcard(require("../../../log"));
8
7
  var Security = _interopRequireWildcard(require("./Security"));
9
8
  var _resolveCertificateSigningIdentity = require("./resolveCertificateSigningIdentity");
10
9
  var _xcodeCodeSigning = require("./xcodeCodeSigning");
10
+ var Log = _interopRequireWildcard(require("../../../log"));
11
11
  function _interopRequireDefault(obj) {
12
12
  return obj && obj.__esModule ? obj : {
13
13
  default: obj
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/codeSigning/configureCodeSigning.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Log from '../../../log';\nimport * as Security from './Security';\nimport { resolveCertificateSigningIdentityAsync } from './resolveCertificateSigningIdentity';\nimport { getCodeSigningInfoForPbxproj, setAutoCodeSigningInfoForPbxproj } from './xcodeCodeSigning';\n\nexport async function ensureDeviceIsCodeSignedForDeploymentAsync(\n projectRoot: string\n): Promise<string | null> {\n if (isCodeSigningConfigured(projectRoot)) {\n return null;\n }\n return configureCodeSigningAsync(projectRoot);\n}\n\nfunction isCodeSigningConfigured(projectRoot: string): boolean {\n // Check if the app already has a development team defined.\n const signingInfo = getCodeSigningInfoForPbxproj(projectRoot);\n\n const allTargetsHaveTeams = Object.values(signingInfo).reduce((prev, curr) => {\n return prev && !!curr.developmentTeams.length;\n }, true);\n\n if (allTargetsHaveTeams) {\n const teamList = Object.values(signingInfo).reduce<string[]>((prev, curr) => {\n return prev.concat([curr.developmentTeams[0]]);\n }, []);\n Log.log(chalk.dim`\\u203A Auto signing app using team(s): ${teamList.join(', ')}`);\n return true;\n }\n\n const allTargetsHaveProfiles = Object.values(signingInfo).reduce((prev, curr) => {\n return prev && !!curr.provisioningProfiles.length;\n }, true);\n\n if (allTargetsHaveProfiles) {\n // this indicates that the user has manual code signing setup (possibly for production).\n return true;\n }\n return false;\n}\n\nasync function configureCodeSigningAsync(projectRoot: string) {\n const ids = await Security.findIdentitiesAsync();\n\n const id = await resolveCertificateSigningIdentityAsync(ids);\n\n Log.log(`\\u203A Signing and building iOS app with: ${id.codeSigningInfo}`);\n\n setAutoCodeSigningInfoForPbxproj(projectRoot, {\n appleTeamId: id.appleTeamId!,\n });\n return id.appleTeamId!;\n}\n"],"names":["ensureDeviceIsCodeSignedForDeploymentAsync","Log","Security","projectRoot","isCodeSigningConfigured","configureCodeSigningAsync","signingInfo","getCodeSigningInfoForPbxproj","allTargetsHaveTeams","Object","values","reduce","prev","curr","developmentTeams","length","teamList","concat","log","chalk","dim","join","allTargetsHaveProfiles","provisioningProfiles","ids","findIdentitiesAsync","id","resolveCertificateSigningIdentityAsync","codeSigningInfo","setAutoCodeSigningInfoForPbxproj","appleTeamId"],"mappings":"AAAA;;;;QAOsBA,0CAA0C,GAA1CA,0CAA0C;AAP9C,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACHC,IAAAA,QAAQ,mCAAM,YAAY,EAAlB;AACmC,IAAA,kCAAqC,WAArC,qCAAqC,CAAA;AACb,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5F,eAAeF,0CAA0C,CAC9DG,WA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AI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;CACd;AAED,eAAejB,yBAAyB,CAACF,WAAmB,EAAE;IAC5D,MAAMqB,GAAG,GAAG,MAAMtB,QAAQ,CAACuB,mBAAmB,EAAE,AAAC;IAEjD,MAAMC,EAAE,GAAG,MAAMC,CAAAA,GAAAA,kCAAsC,AAAK,CAAA,uCAAL,CAACH,GAAG,CAAC,AAAC;IAE7DvB,GAAG,CAACiB,GAAG,CAAC,CAAC,0CAA0C,EAAEQ,EAAE,CAACE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE3EC,CAAAA,GAAAA,iBAAgC,AAE9B,CAAA,iCAF8B,CAAC1B,WAAW,EAAE;QAC5C2B,WAAW,EAAEJ,EAAE,CAACI,WAAW;KAC5B,CAAC,CAAC;IACH,OAAOJ,EAAE,CAACI,WAAW,CAAE;CACxB"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/codeSigning/configureCodeSigning.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Security from './Security';\nimport { resolveCertificateSigningIdentityAsync } from './resolveCertificateSigningIdentity';\nimport { getCodeSigningInfoForPbxproj, setAutoCodeSigningInfoForPbxproj } from './xcodeCodeSigning';\nimport * as Log from '../../../log';\n\nexport async function ensureDeviceIsCodeSignedForDeploymentAsync(\n projectRoot: string\n): Promise<string | null> {\n if (isCodeSigningConfigured(projectRoot)) {\n return null;\n }\n return configureCodeSigningAsync(projectRoot);\n}\n\nfunction isCodeSigningConfigured(projectRoot: string): boolean {\n // Check if the app already has a development team defined.\n const signingInfo = getCodeSigningInfoForPbxproj(projectRoot);\n\n const allTargetsHaveTeams = Object.values(signingInfo).reduce((prev, curr) => {\n return prev && !!curr.developmentTeams.length;\n }, true);\n\n if (allTargetsHaveTeams) {\n const teamList = Object.values(signingInfo).reduce<string[]>((prev, curr) => {\n return prev.concat([curr.developmentTeams[0]]);\n }, []);\n Log.log(chalk.dim`\\u203A Auto signing app using team(s): ${teamList.join(', ')}`);\n return true;\n }\n\n const allTargetsHaveProfiles = Object.values(signingInfo).reduce((prev, curr) => {\n return prev && !!curr.provisioningProfiles.length;\n }, true);\n\n if (allTargetsHaveProfiles) {\n // this indicates that the user has manual code signing setup (possibly for production).\n return true;\n }\n return false;\n}\n\nasync function configureCodeSigningAsync(projectRoot: string) {\n const ids = await Security.findIdentitiesAsync();\n\n const id = await resolveCertificateSigningIdentityAsync(ids);\n\n Log.log(`\\u203A Signing and building iOS app with: ${id.codeSigningInfo}`);\n\n setAutoCodeSigningInfoForPbxproj(projectRoot, {\n appleTeamId: id.appleTeamId!,\n });\n return id.appleTeamId!;\n}\n"],"names":["ensureDeviceIsCodeSignedForDeploymentAsync","Security","Log","projectRoot","isCodeSigningConfigured","configureCodeSigningAsync","signingInfo","getCodeSigningInfoForPbxproj","allTargetsHaveTeams","Object","values","reduce","prev","curr","developmentTeams","length","teamList","concat","log","chalk","dim","join","allTargetsHaveProfiles","provisioningProfiles","ids","findIdentitiesAsync","id","resolveCertificateSigningIdentityAsync","codeSigningInfo","setAutoCodeSigningInfoForPbxproj","appleTeamId"],"mappings":"AAAA;;;;QAOsBA,0CAA0C,GAA1CA,0CAA0C;AAP9C,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,QAAQ,mCAAM,YAAY,EAAlB;AACmC,IAAA,kCAAqC,WAArC,qCAAqC,CAAA;AACb,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AACvFC,IAAAA,GAAG,mCAAM,cAAc,EAApB;;;;;;;;;;;;;;;;;;;;;;;;;;;AAER,eAAeF,0CAA0C,CAC9DG,WAAmB,EACK;IACxB,IAAIC,uBAAuB,CAACD,WAAW,CAAC,EAAE;QACxC,OAAO,IAAI,CAAC;KACb;IACD,OAAOE,yBAAyB,CAACF,WAAW,CAAC,CAAC;CAC/C;AAED,SAASC,uBAAuB,CAACD,WAAmB,EAAW;IAC7D,2DAA2D;IAC3D,MAAMG,WAAW,GAAGC,CAAAA,GAAAA,iBAA4B,AAAa,C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AAAC;IAE7DtB,GAAG,CAACgB,GAAG,CAAC,CAAC,0CAA0C,EAAEQ,EAAE,CAACE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE3EC,CAAAA,GAAAA,iBAAgC,AAE9B,CAAA,iCAF8B,CAAC1B,WAAW,EAAE;QAC5C2B,WAAW,EAAEJ,EAAE,CAACI,WAAW;KAC5B,CAAC,CAAC;IACH,OAAOJ,EAAE,CAACI,WAAW,CAAE;CACxB"}
@@ -6,13 +6,13 @@ exports.sortDefaultIdToBeginningAsync = sortDefaultIdToBeginningAsync;
6
6
  exports.resolveCertificateSigningIdentityAsync = resolveCertificateSigningIdentityAsync;
7
7
  exports.selectDevelopmentTeamAsync = selectDevelopmentTeamAsync;
8
8
  var _chalk = _interopRequireDefault(require("chalk"));
9
+ var Security = _interopRequireWildcard(require("./Security"));
10
+ var _settings = require("./settings");
9
11
  var Log = _interopRequireWildcard(require("../../../log"));
10
12
  var _errors = require("../../../utils/errors");
11
13
  var _interactive = require("../../../utils/interactive");
12
14
  var _link = require("../../../utils/link");
13
15
  var _prompts = require("../../../utils/prompts");
14
- var Security = _interopRequireWildcard(require("./Security"));
15
- var _settings = require("./settings");
16
16
  function _interopRequireDefault(obj) {
17
17
  return obj && obj.__esModule ? obj : {
18
18
  default: obj
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/codeSigning/resolveCertificateSigningIdentity.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { learnMore } from '../../../utils/link';\nimport { selectAsync } from '../../../utils/prompts';\nimport * as Security from './Security';\nimport { getLastDeveloperCodeSigningIdAsync, setLastDeveloperCodeSigningIdAsync } from './settings';\n\n/**\n * Sort the code signing items so the last selected item (user's default) is the first suggested.\n */\nexport async function sortDefaultIdToBeginningAsync(\n identities: Security.CertificateSigningInfo[]\n): Promise<[Security.CertificateSigningInfo[], string | null]> {\n const lastSelected = await getLastDeveloperCodeSigningIdAsync();\n\n if (lastSelected) {\n let iterations = 0;\n while (identities[0].signingCertificateId !== lastSelected && iterations < identities.length) {\n identities.push(identities.shift()!);\n iterations++;\n }\n }\n return [identities, lastSelected];\n}\n\n/**\n * Assert that the computer needs code signing setup.\n * This links to an FYI page that was user tested internally.\n */\nfunction assertCodeSigningSetup(): never {\n // TODO: We can probably do this too automatically.\n Log.log(\n `\\u203A Your computer requires some additional setup before you can build onto physical iOS devices.\\n ${chalk.bold(\n learnMore('https://expo.fyi/setup-xcode-signing')\n )}`\n );\n\n throw new CommandError('No code signing certificates are available to use.');\n}\n\n/**\n * Resolve the best certificate signing identity from a given list of IDs.\n * - If no IDs: Assert that the user has to setup code signing.\n * - If one ID: Return the first ID.\n * - If multiple IDs: Ask the user to select one, then store the value to be suggested first next time (since users generally use the same ID).\n */\nexport async function resolveCertificateSigningIdentityAsync(\n ids: string[]\n): Promise<Security.CertificateSigningInfo> {\n // The user has no valid code signing identities.\n if (!ids.length) {\n assertCodeSigningSetup();\n }\n\n // One ID available 🤝 Program is not interactive\n //\n // using the the first available option\n if (ids.length === 1 || !isInteractive()) {\n // This method is cheaper than `resolveIdentitiesAsync` and checking the\n // cached user preference so we should use this as early as possible.\n return Security.resolveCertificateSigningInfoAsync(ids[0]);\n }\n\n // Get identities and sort by the one that the user is most likely to choose.\n const [identities, preferred] = await sortDefaultIdToBeginningAsync(\n await Security.resolveIdentitiesAsync(ids)\n );\n\n const selected = await selectDevelopmentTeamAsync(identities, preferred);\n\n // Store the last used value and suggest it as the first value\n // next time the user has to select a code signing identity.\n await setLastDeveloperCodeSigningIdAsync(selected.signingCertificateId);\n\n return selected;\n}\n\n/** Prompt the user to select a development team, highlighting the preferred value based on the user history. */\nexport async function selectDevelopmentTeamAsync(\n identities: Security.CertificateSigningInfo[],\n preferredId: string | null\n): Promise<Security.CertificateSigningInfo> {\n const index = await selectAsync(\n 'Development team for signing the app',\n identities.map((value, i) => {\n const format =\n value.signingCertificateId === preferredId ? chalk.bold : (message: string) => message;\n return {\n // Formatted like: `650 Industries, Inc. (A1BCDEF234) - Apple Development: Evan Bacon (AA00AABB0A)`\n title: format(\n [value.appleTeamName, `(${value.appleTeamId}) -`, value.codeSigningInfo].join(' ')\n ),\n value: i,\n };\n })\n );\n\n return identities[index];\n}\n"],"names":["sortDefaultIdToBeginningAsync","resolveCertificateSigningIdentityAsync","selectDevelopmentTeamAsync","Log","Security","identities","lastSelected","getLastDeveloperCodeSigningIdAsync","iterations","signingCertificateId","length","push","shift","assertCodeSigningSetup","log","chalk","bold","learnMore","CommandError","ids","isInteractive","resolveCertificateSigningInfoAsync","preferred","resolveIdentitiesAsync","selected","setLastDeveloperCodeSigningIdAsync","preferredId","index","selectAsync","map","value","i","format","message","title","appleTeamName","appleTeamId","codeSigningInfo","join"],"mappings":"AAAA;;;;QAasBA,6BAA6B,GAA7BA,6BAA6B;QAoC7BC,sCAAsC,GAAtCA,sCAAsC;QAgCtCC,0BAA0B,GAA1BA,0BAA0B;AAjF9B,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACc,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACtB,IAAA,YAA4B,WAA5B,4BAA4B,CAAA;AAChC,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACnB,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACxCC,IAAAA,QAAQ,mCAAM,YAAY,EAAlB;AACmE,IAAA,SAAY,WAAZ,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK5F,eAAeJ,6BAA6B,CACjDK,UAA6C,EACgB;IAC7D,MAAMC,YAAY,GAAG,MAAMC,CAAAA,GAAAA,SAAkC,AAAE,CAAA,mCAAF,EAAE,AAAC;IAEhE,IAAID,YAAY,EAAE;QAChB,IAAIE,UAAU,GAAG,CAAC,AAAC;QACnB,MAAOH,UAAU,CAAC,CAAC,CAAC,CAACI,oBAAo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ACD,QAAQ,CAACf,oBAAoB,CAAC,CAAC;IAExE,OAAOe,QAAQ,CAAC;CACjB;AAGM,eAAetB,0BAA0B,CAC9CG,UAA6C,EAC7CqB,WAA0B,EACgB;IAC1C,MAAMC,KAAK,GAAG,MAAMC,CAAAA,GAAAA,QAAW,AAa9B,CAAA,YAb8B,CAC7B,sCAAsC,EACtCvB,UAAU,CAACwB,GAAG,CAAC,CAACC,KAAK,EAAEC,CAAC,GAAK;QAC3B,MAAMC,MAAM,GACVF,KAAK,CAACrB,oBAAoB,KAAKiB,WAAW,GAAGX,MAAK,QAAA,CAACC,IAAI,GAAG,CAACiB,OAAe,GAAKA,OAAO;QAAC;QACzF,OAAO;YACL,mGAAmG;YACnGC,KAAK,EAAEF,MAAM,CACX;gBAACF,KAAK,CAACK,aAAa;gBAAE,CAAC,CAAC,EAAEL,KAAK,CAACM,WAAW,CAAC,GAAG,CAAC;gBAAEN,KAAK,CAACO,eAAe;aAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACnF;YACDR,KAAK,EAAEC,CAAC;SACT,CAAC;KACH,CAAC,CACH,AAAC;IAEF,OAAO1B,UAAU,CAACsB,KAAK,CAAC,CAAC;CAC1B"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/codeSigning/resolveCertificateSigningIdentity.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Security from './Security';\nimport { getLastDeveloperCodeSigningIdAsync, setLastDeveloperCodeSigningIdAsync } from './settings';\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { isInteractive } from '../../../utils/interactive';\nimport { learnMore } from '../../../utils/link';\nimport { selectAsync } from '../../../utils/prompts';\n\n/**\n * Sort the code signing items so the last selected item (user's default) is the first suggested.\n */\nexport async function sortDefaultIdToBeginningAsync(\n identities: Security.CertificateSigningInfo[]\n): Promise<[Security.CertificateSigningInfo[], string | null]> {\n const lastSelected = await getLastDeveloperCodeSigningIdAsync();\n\n if (lastSelected) {\n let iterations = 0;\n while (identities[0].signingCertificateId !== lastSelected && iterations < identities.length) {\n identities.push(identities.shift()!);\n iterations++;\n }\n }\n return [identities, lastSelected];\n}\n\n/**\n * Assert that the computer needs code signing setup.\n * This links to an FYI page that was user tested internally.\n */\nfunction assertCodeSigningSetup(): never {\n // TODO: We can probably do this too automatically.\n Log.log(\n `\\u203A Your computer requires some additional setup before you can build onto physical iOS devices.\\n ${chalk.bold(\n learnMore('https://expo.fyi/setup-xcode-signing')\n )}`\n );\n\n throw new CommandError('No code signing certificates are available to use.');\n}\n\n/**\n * Resolve the best certificate signing identity from a given list of IDs.\n * - If no IDs: Assert that the user has to setup code signing.\n * - If one ID: Return the first ID.\n * - If multiple IDs: Ask the user to select one, then store the value to be suggested first next time (since users generally use the same ID).\n */\nexport async function resolveCertificateSigningIdentityAsync(\n ids: string[]\n): Promise<Security.CertificateSigningInfo> {\n // The user has no valid code signing identities.\n if (!ids.length) {\n assertCodeSigningSetup();\n }\n\n // One ID available 🤝 Program is not interactive\n //\n // using the the first available option\n if (ids.length === 1 || !isInteractive()) {\n // This method is cheaper than `resolveIdentitiesAsync` and checking the\n // cached user preference so we should use this as early as possible.\n return Security.resolveCertificateSigningInfoAsync(ids[0]);\n }\n\n // Get identities and sort by the one that the user is most likely to choose.\n const [identities, preferred] = await sortDefaultIdToBeginningAsync(\n await Security.resolveIdentitiesAsync(ids)\n );\n\n const selected = await selectDevelopmentTeamAsync(identities, preferred);\n\n // Store the last used value and suggest it as the first value\n // next time the user has to select a code signing identity.\n await setLastDeveloperCodeSigningIdAsync(selected.signingCertificateId);\n\n return selected;\n}\n\n/** Prompt the user to select a development team, highlighting the preferred value based on the user history. */\nexport async function selectDevelopmentTeamAsync(\n identities: Security.CertificateSigningInfo[],\n preferredId: string | null\n): Promise<Security.CertificateSigningInfo> {\n const index = await selectAsync(\n 'Development team for signing the app',\n identities.map((value, i) => {\n const format =\n value.signingCertificateId === preferredId ? chalk.bold : (message: string) => message;\n return {\n // Formatted like: `650 Industries, Inc. (A1BCDEF234) - Apple Development: Evan Bacon (AA00AABB0A)`\n title: format(\n [value.appleTeamName, `(${value.appleTeamId}) -`, value.codeSigningInfo].join(' ')\n ),\n value: i,\n };\n })\n );\n\n return identities[index];\n}\n"],"names":["sortDefaultIdToBeginningAsync","resolveCertificateSigningIdentityAsync","selectDevelopmentTeamAsync","Security","Log","identities","lastSelected","getLastDeveloperCodeSigningIdAsync","iterations","signingCertificateId","length","push","shift","assertCodeSigningSetup","log","chalk","bold","learnMore","CommandError","ids","isInteractive","resolveCertificateSigningInfoAsync","preferred","resolveIdentitiesAsync","selected","setLastDeveloperCodeSigningIdAsync","preferredId","index","selectAsync","map","value","i","format","message","title","appleTeamName","appleTeamId","codeSigningInfo","join"],"mappings":"AAAA;;;;QAasBA,6BAA6B,GAA7BA,6BAA6B;QAoC7BC,sCAAsC,GAAtCA,sCAAsC;QAgCtCC,0BAA0B,GAA1BA,0BAA0B;AAjF9B,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,QAAQ,mCAAM,YAAY,EAAlB;AACmE,IAAA,SAAY,WAAZ,YAAY,CAAA;AACvFC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACc,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACtB,IAAA,YAA4B,WAA5B,4BAA4B,CAAA;AAChC,IAAA,KAAqB,WAArB,qBAAqB,CAAA;AACnB,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK7C,eAAeJ,6BAA6B,CACjDK,UAA6C,EACgB;IAC7D,MAAMC,YAAY,GAAG,MAAMC,CAAAA,GAAAA,SAAkC,AAAE,CAAA,mCAAF,EAAE,AAAC;IAEhE,IAAID,YAAY,EAAE;QAChB,IAAIE,UAAU,GAAG,CAAC,AAAC;QACnB,MAAOH,UAAU,CAAC,CAAC,CAAC,CAACI,oBAAoB,KAAKH,YAAY,IAAIE,UAAU,GAAGH,UAAU,CAACK,MAAM,CAAE;YAC5F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jB;AAGM,eAAetB,0BAA0B,CAC9CG,UAA6C,EAC7CqB,WAA0B,EACgB;IAC1C,MAAMC,KAAK,GAAG,MAAMC,CAAAA,GAAAA,QAAW,AAa9B,CAAA,YAb8B,CAC7B,sCAAsC,EACtCvB,UAAU,CAACwB,GAAG,CAAC,CAACC,KAAK,EAAEC,CAAC,GAAK;QAC3B,MAAMC,MAAM,GACVF,KAAK,CAACrB,oBAAoB,KAAKiB,WAAW,GAAGX,MAAK,QAAA,CAACC,IAAI,GAAG,CAACiB,OAAe,GAAKA,OAAO;QAAC;QACzF,OAAO;YACL,mGAAmG;YACnGC,KAAK,EAAEF,MAAM,CACX;gBAACF,KAAK,CAACK,aAAa;gBAAE,CAAC,CAAC,EAAEL,KAAK,CAACM,WAAW,CAAC,GAAG,CAAC;gBAAEN,KAAK,CAACO,eAAe;aAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACnF;YACDR,KAAK,EAAEC,CAAC;SACT,CAAC;KACH,CAAC,CACH,AAAC;IAEF,OAAO1B,UAAU,CAACsB,KAAK,CAAC,CAAC;CAC1B"}
@@ -49,6 +49,9 @@ function mutateXcodeProjectWithAutoCodeSigningInfo({ project , appleTeamId }) {
49
49
  item.buildSettings.CODE_SIGN_STYLE = "Automatic";
50
50
  });
51
51
  Object.entries(_configPlugins.IOSConfig.XcodeUtils.getProjectSection(project)).filter(_configPlugins.IOSConfig.XcodeUtils.isNotComment).forEach(([, item])=>{
52
+ if (!item.attributes.TargetAttributes) {
53
+ item.attributes.TargetAttributes = {};
54
+ }
52
55
  if (!item.attributes.TargetAttributes[nativeTargetId]) {
53
56
  item.attributes.TargetAttributes[nativeTargetId] = {};
54
57
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/codeSigning/xcodeCodeSigning.ts"],"sourcesContent":["import { IOSConfig, XcodeProject } from '@expo/config-plugins';\nimport fs from 'fs';\n\nexport type CodeSigningInfo = Record<\n string,\n {\n developmentTeams: string[];\n provisioningProfiles: string[];\n }\n>;\n\n/** Find the development team and provisioning profile that's currently in use by the Xcode project. */\nexport function getCodeSigningInfoForPbxproj(projectRoot: string): CodeSigningInfo {\n const project = IOSConfig.XcodeUtils.getPbxproj(projectRoot);\n const targets = IOSConfig.Target.findSignableTargets(project);\n\n const signingInfo: CodeSigningInfo = {};\n for (const [nativeTargetId, nativeTarget] of targets) {\n const developmentTeams: string[] = [];\n const provisioningProfiles: string[] = [];\n\n IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n nativeTarget.buildConfigurationList\n )\n .filter(\n ([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) =>\n item.buildSettings.PRODUCT_NAME\n )\n .forEach(([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) => {\n const { DEVELOPMENT_TEAM, PROVISIONING_PROFILE } = item.buildSettings;\n if (\n typeof DEVELOPMENT_TEAM === 'string' &&\n // If the user selects \"Team: none\" in Xcode, it'll be an empty string.\n !!DEVELOPMENT_TEAM &&\n // xcode package sometimes reads an empty string as a quoted empty string.\n DEVELOPMENT_TEAM !== '\"\"'\n ) {\n developmentTeams.push(DEVELOPMENT_TEAM);\n }\n if (typeof PROVISIONING_PROFILE === 'string' && !!PROVISIONING_PROFILE) {\n provisioningProfiles.push(PROVISIONING_PROFILE);\n }\n });\n signingInfo[nativeTargetId] = {\n developmentTeams,\n provisioningProfiles,\n };\n }\n\n return signingInfo;\n}\n\n/**\n * Set the development team and configure the Xcode project for automatic code signing,\n * this helps us resolve the code signing on subsequent runs and emulates Xcode behavior.\n *\n * @param props.project xcode project object from `xcode` package.\n * @param props.appleTeamId Apple Team ID to use for code signing.\n */\nexport function mutateXcodeProjectWithAutoCodeSigningInfo({\n project,\n appleTeamId,\n}: {\n project: XcodeProject;\n appleTeamId: string;\n}): XcodeProject {\n const targets = IOSConfig.Target.findSignableTargets(project);\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n for (const [nativeTargetId, nativeTarget] of targets) {\n IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n nativeTarget.buildConfigurationList\n )\n .filter(\n ([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) =>\n item.buildSettings.PRODUCT_NAME\n )\n .forEach(([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) => {\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"Apple Development\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Automatic';\n });\n\n Object.entries(IOSConfig.XcodeUtils.getProjectSection(project))\n .filter(IOSConfig.XcodeUtils.isNotComment)\n .forEach(([, item]: IOSConfig.XcodeUtils.ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Automatic';\n });\n }\n\n return project;\n}\n\n/**\n * Configures the Xcode project for automatic code signing and persists the results.\n */\nexport function setAutoCodeSigningInfoForPbxproj(\n projectRoot: string,\n { appleTeamId }: { appleTeamId: string }\n): void {\n const project = IOSConfig.XcodeUtils.getPbxproj(projectRoot);\n mutateXcodeProjectWithAutoCodeSigningInfo({ project, appleTeamId });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"names":["getCodeSigningInfoForPbxproj","mutateXcodeProjectWithAutoCodeSigningInfo","setAutoCodeSigningInfoForPbxproj","projectRoot","project","IOSConfig","XcodeUtils","getPbxproj","targets","Target","findSignableTargets","signingInfo","nativeTargetId","nativeTarget","developmentTeams","provisioningProfiles","getBuildConfigurationsForListId","buildConfigurationList","filter","item","buildSettings","PRODUCT_NAME","forEach","DEVELOPMENT_TEAM","PROVISIONING_PROFILE","push","appleTeamId","quotedAppleTeamId","ensureQuotes","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","getProjectSection","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"mappings":"AAAA;;;;QAYgBA,4BAA4B,GAA5BA,4BAA4B;QAgD5BC,yCAAyC,GAAzCA,yCAAyC;QA4CzCC,gCAAgC,GAAhCA,gCAAgC;AAxGR,IAAA,cAAsB,WAAtB,sBAAsB,CAAA;AAC/C,IAAA,GAAI,kCAAJ,IAAI,EAAA;;;;;;AAWZ,SAASF,4BAA4B,CAACG,WAAmB,EAAmB;IACjF,MAAMC,OAAO,GAAGC,cAAS,UAAA,CAACC,UAAU,CAACC,UAAU,CAACJ,WAAW,CAAC,AAAC;IAC7D,MAAMK,OAAO,GAAGH,cAAS,UAAA,CAACI,MAAM,CAACC,mBAAmB,CAACN,OAAO,CAAC,AAAC;IAE9D,MAAMO,WAAW,GAAoB,EAAE,AAAC;IACxC,KAAK,MAAM,CAACC,cAAc,EAAEC,YAAY,CAAC,IAAIL,OAAO,CAAE;QACpD,MAAMM,gBAAgB,GAAa,EAAE,AAAC;QACtC,MAAMC,oBAAoB,GAAa,EAAE,AAAC;QAE1CV,cAAS,UAAA,CAACC,UAAU,CAACU,+BAA+B,CAClDZ,OAAO,EACPS,YAAY,CAACI,sBAAsB,CACpC,CACEC,MAAM,CACL,CAAC,GAAGC,IAAI,CAAiD,GACvDA,IAAI,CAACC,aAAa,CAACC,YAAY;QAAA,CAClC,CACAC,OAAO,CAAC,CAAC,GAAGH,IAAI,CAAiD,GAAK;YACrE,MAAM,EAAEI,gBAAgB,CAAA,EAAEC,oBAAoB,CAAA,EAAE,GAAGL,IAAI,CAACC,aAAa,AAAC;YACtE,IACE,OAAOG,gBAAgB,KAAK,QAAQ,IACpC,uEAAuE;YACvE,CAAC,CAACA,gBAAgB,IAClB,0EAA0E;YAC1EA,gBAAgB,KAAK,IAAI,EACzB;gBACAT,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AC,CAAC,GAAGH,IAAI,CAA2C,GAAK;YAC/D,IAAI,CAACA,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,EAAE;gBACrDO,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,GAAG,EAAE,CAAC;aACvD;YAEDO,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,CAACyB,eAAe,GAAGV,iBAAiB,CAAC;YACrFR,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,CAAC0B,iBAAiB,GAAG,WAAW,CAAC;SAClF,CAAC,CAAC;KACN;IAED,OAAOlC,OAAO,CAAC;CAChB;AAKM,SAASF,gCAAgC,CAC9CC,WAAmB,EACnB,EAAEuB,WAAW,CAAA,EAA2B,EAClC;IACN,MAAMtB,OAAO,GAAGC,cAAS,UAAA,CAACC,UAAU,CAACC,UAAU,CAACJ,WAAW,CAAC,AAAC;IAC7DF,yCAAyC,CAAC;QAAEG,OAAO;QAAEsB,WAAW;KAAE,CAAC,CAAC;IAEpEa,GAAE,QAAA,CAACC,aAAa,CAACpC,OAAO,CAACqC,QAAQ,EAAErC,OAAO,CAACsC,SAAS,EAAE,CAAC,CAAC;CACzD;AAED,MAAMd,YAAY,GAAG,CAACe,KAAa,GAAK;IACtC,IAAI,CAACA,KAAK,CAACC,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,CAAC,EAAED,KAAK,CAAC,CAAC,CAAC,CAAC;KACrB;IACD,OAAOA,KAAK,CAAC;CACd,AAAC"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/codeSigning/xcodeCodeSigning.ts"],"sourcesContent":["import { IOSConfig, XcodeProject } from '@expo/config-plugins';\nimport fs from 'fs';\n\nexport type CodeSigningInfo = Record<\n string,\n {\n developmentTeams: string[];\n provisioningProfiles: string[];\n }\n>;\n\n/** Find the development team and provisioning profile that's currently in use by the Xcode project. */\nexport function getCodeSigningInfoForPbxproj(projectRoot: string): CodeSigningInfo {\n const project = IOSConfig.XcodeUtils.getPbxproj(projectRoot);\n const targets = IOSConfig.Target.findSignableTargets(project);\n\n const signingInfo: CodeSigningInfo = {};\n for (const [nativeTargetId, nativeTarget] of targets) {\n const developmentTeams: string[] = [];\n const provisioningProfiles: string[] = [];\n\n IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n nativeTarget.buildConfigurationList\n )\n .filter(\n ([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) =>\n item.buildSettings.PRODUCT_NAME\n )\n .forEach(([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) => {\n const { DEVELOPMENT_TEAM, PROVISIONING_PROFILE } = item.buildSettings;\n if (\n typeof DEVELOPMENT_TEAM === 'string' &&\n // If the user selects \"Team: none\" in Xcode, it'll be an empty string.\n !!DEVELOPMENT_TEAM &&\n // xcode package sometimes reads an empty string as a quoted empty string.\n DEVELOPMENT_TEAM !== '\"\"'\n ) {\n developmentTeams.push(DEVELOPMENT_TEAM);\n }\n if (typeof PROVISIONING_PROFILE === 'string' && !!PROVISIONING_PROFILE) {\n provisioningProfiles.push(PROVISIONING_PROFILE);\n }\n });\n signingInfo[nativeTargetId] = {\n developmentTeams,\n provisioningProfiles,\n };\n }\n\n return signingInfo;\n}\n\n/**\n * Set the development team and configure the Xcode project for automatic code signing,\n * this helps us resolve the code signing on subsequent runs and emulates Xcode behavior.\n *\n * @param props.project xcode project object from `xcode` package.\n * @param props.appleTeamId Apple Team ID to use for code signing.\n */\nexport function mutateXcodeProjectWithAutoCodeSigningInfo({\n project,\n appleTeamId,\n}: {\n project: XcodeProject;\n appleTeamId: string;\n}): XcodeProject {\n const targets = IOSConfig.Target.findSignableTargets(project);\n\n const quotedAppleTeamId = ensureQuotes(appleTeamId);\n\n for (const [nativeTargetId, nativeTarget] of targets) {\n IOSConfig.XcodeUtils.getBuildConfigurationsForListId(\n project,\n nativeTarget.buildConfigurationList\n )\n .filter(\n ([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) =>\n item.buildSettings.PRODUCT_NAME\n )\n .forEach(([, item]: IOSConfig.XcodeUtils.ConfigurationSectionEntry) => {\n item.buildSettings.DEVELOPMENT_TEAM = quotedAppleTeamId;\n item.buildSettings.CODE_SIGN_IDENTITY = '\"Apple Development\"';\n item.buildSettings.CODE_SIGN_STYLE = 'Automatic';\n });\n\n Object.entries(IOSConfig.XcodeUtils.getProjectSection(project))\n .filter(IOSConfig.XcodeUtils.isNotComment)\n .forEach(([, item]: IOSConfig.XcodeUtils.ProjectSectionEntry) => {\n if (!item.attributes.TargetAttributes) {\n item.attributes.TargetAttributes = {};\n }\n\n if (!item.attributes.TargetAttributes[nativeTargetId]) {\n item.attributes.TargetAttributes[nativeTargetId] = {};\n }\n\n item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam = quotedAppleTeamId;\n item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle = 'Automatic';\n });\n }\n\n return project;\n}\n\n/**\n * Configures the Xcode project for automatic code signing and persists the results.\n */\nexport function setAutoCodeSigningInfoForPbxproj(\n projectRoot: string,\n { appleTeamId }: { appleTeamId: string }\n): void {\n const project = IOSConfig.XcodeUtils.getPbxproj(projectRoot);\n mutateXcodeProjectWithAutoCodeSigningInfo({ project, appleTeamId });\n\n fs.writeFileSync(project.filepath, project.writeSync());\n}\n\nconst ensureQuotes = (value: string) => {\n if (!value.match(/^['\"]/)) {\n return `\"${value}\"`;\n }\n return value;\n};\n"],"names":["getCodeSigningInfoForPbxproj","mutateXcodeProjectWithAutoCodeSigningInfo","setAutoCodeSigningInfoForPbxproj","projectRoot","project","IOSConfig","XcodeUtils","getPbxproj","targets","Target","findSignableTargets","signingInfo","nativeTargetId","nativeTarget","developmentTeams","provisioningProfiles","getBuildConfigurationsForListId","buildConfigurationList","filter","item","buildSettings","PRODUCT_NAME","forEach","DEVELOPMENT_TEAM","PROVISIONING_PROFILE","push","appleTeamId","quotedAppleTeamId","ensureQuotes","CODE_SIGN_IDENTITY","CODE_SIGN_STYLE","Object","entries","getProjectSection","isNotComment","attributes","TargetAttributes","DevelopmentTeam","ProvisioningStyle","fs","writeFileSync","filepath","writeSync","value","match"],"mappings":"AAAA;;;;QAYgBA,4BAA4B,GAA5BA,4BAA4B;QAgD5BC,yCAAyC,GAAzCA,yCAAyC;QAgDzCC,gCAAgC,GAAhCA,gCAAgC;AA5GR,IAAA,cAAsB,WAAtB,sBAAsB,CAAA;AAC/C,IAAA,GAAI,kCAAJ,IAAI,EAAA;;;;;;AAWZ,SAASF,4BAA4B,CAACG,WAAmB,EAAmB;IACjF,MAAMC,OAAO,GAAGC,cAAS,UAAA,CAACC,UAAU,CAACC,UAAU,CAACJ,WAAW,CAAC,AAAC;IAC7D,MAAMK,OAAO,GAAGH,cAAS,UAAA,CAACI,MAAM,CAACC,mBAAmB,CAACN,OAAO,CAAC,AAAC;IAE9D,MAAMO,WAAW,GAAoB,EAAE,AAAC;IACxC,KAAK,MAAM,CAACC,cAAc,EAAEC,YAAY,CAAC,IAAIL,OAAO,CAAE;QACpD,MAAMM,gBAAgB,GAAa,EAAE,AAAC;QACtC,MAAMC,oBAAoB,GAAa,EAAE,AAAC;QAE1CV,cAAS,UAAA,CAACC,UAAU,CAACU,+BAA+B,CAClDZ,OAAO,EACPS,YAAY,CAACI,sBAAsB,CACpC,CACEC,MAAM,CACL,CAAC,GAAGC,IAAI,CAAiD,GACvDA,IAAI,CAACC,aAAa,CAACC,YAAY;QAAA,CAClC,CACAC,OAAO,CAAC,CAAC,GAAGH,IAAI,CAAiD,GAAK;YACrE,MAAM,EAAEI,gBAAgB,CAAA,EAAEC,oBAAoB,CAAA,EAAE,GAAGL,IAAI,CAACC,aAAa,AAAC;YACtE,IACE,OAAOG,gBAAgB,KAAK,QAAQ,IACpC,uEAAuE;YACvE,CAAC,CAACA,gBAAgB,IAClB,0EAA0E;YAC1EA,gBAAgB,KAAK,IAAI,EACzB;gBACAT,gBAAgB,CAACW,IAAI,CA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CAA2C,GAAK;YAC/D,IAAI,CAACA,IAAI,CAACgB,UAAU,CAACC,gBAAgB,EAAE;gBACrCjB,IAAI,CAACgB,UAAU,CAACC,gBAAgB,GAAG,EAAE,CAAC;aACvC;YAED,IAAI,CAACjB,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,EAAE;gBACrDO,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,GAAG,EAAE,CAAC;aACvD;YAEDO,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,CAACyB,eAAe,GAAGV,iBAAiB,CAAC;YACrFR,IAAI,CAACgB,UAAU,CAACC,gBAAgB,CAACxB,cAAc,CAAC,CAAC0B,iBAAiB,GAAG,WAAW,CAAC;SAClF,CAAC,CAAC;KACN;IAED,OAAOlC,OAAO,CAAC;CAChB;AAKM,SAASF,gCAAgC,CAC9CC,WAAmB,EACnB,EAAEuB,WAAW,CAAA,EAA2B,EAClC;IACN,MAAMtB,OAAO,GAAGC,cAAS,UAAA,CAACC,UAAU,CAACC,UAAU,CAACJ,WAAW,CAAC,AAAC;IAC7DF,yCAAyC,CAAC;QAAEG,OAAO;QAAEsB,WAAW;KAAE,CAAC,CAAC;IAEpEa,GAAE,QAAA,CAACC,aAAa,CAACpC,OAAO,CAACqC,QAAQ,EAAErC,OAAO,CAACsC,SAAS,EAAE,CAAC,CAAC;CACzD;AAED,MAAMd,YAAY,GAAG,CAACe,KAAa,GAAK;IACtC,IAAI,CAACA,KAAK,CAACC,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,CAAC,EAAED,KAAK,CAAC,CAAC,CAAC,CAAC;KACrB;IACD,OAAOA,KAAK,CAAC;CACd,AAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\nimport { logCmdError } from '../../utils/errors';\nimport { XcodeConfiguration } from './XcodeBuild.types';\n\nexport const expoRunIos: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--help': Boolean,\n '--no-build-cache': Boolean,\n '--no-install': Boolean,\n '--no-bundler': Boolean,\n '--configuration': String,\n\n '--port': Number,\n // Aliases\n '-p': '--port',\n\n '-h': '--help',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n\n permissive: true,\n });\n\n // '-d' -> '--device': Boolean,\n // '--scheme': String,\n\n if (args['--help']) {\n printHelp(\n `Run the iOS app binary locally`,\n `npx expo run:ios`,\n [\n `--no-build-cache Clear the native derived data before building`,\n `--no-install Skip installing dependencies`,\n `--no-bundler Skip starting the Metro bundler`,\n `--scheme [scheme] Scheme to build`,\n chalk`--configuration <configuration> Xcode configuration to use. Debug or Release. {dim Default: Debug}`,\n `-d, --device [device] Device name or UDID to build the app on`,\n chalk`-p, --port <port> Port to start the Metro bundler on. {dim Default: 8081}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Build for production (unsigned) with the {bold Release} configuration:`,\n chalk` {dim $} npx expo run:ios --configuration Release`,\n '',\n ].join('\\n')\n );\n }\n\n const { resolveStringOrBooleanArgsAsync } = await import('../../utils/resolveArgs');\n const parsed = await resolveStringOrBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--scheme': Boolean,\n '--device': Boolean,\n '-d': '--device',\n }).catch(logCmdError);\n\n const { runIosAsync } = await import('./runIosAsync');\n return runIosAsync(path.resolve(parsed.projectRoot), {\n // Parsed options\n buildCache: !args['--no-build-cache'],\n install: !args['--no-install'],\n bundler: !args['--no-bundler'],\n port: args['--port'],\n\n // Custom parsed args\n device: parsed.args['--device'],\n scheme: parsed.args['--scheme'],\n configuration: parsed.args['--configuration'] as XcodeConfiguration,\n }).catch(logCmdError);\n};\n"],"names":["expoRunIos","argv","rawArgsMap","Boolean","String","Number","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","resolveStringOrBooleanArgsAsync","parsed","catch","logCmdError","runIosAsync","path","resolve","projectRoot","buildCache","install","bundler","port","device","scheme","configuration"],"mappings":"AAAA;;;;;;AAEkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAG0B,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AACvC,IAAA,OAAoB,WAApB,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGzC,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,kBAAkB,EAAEA,OAAO;QAC3B,cAAc,EAAEA,OAAO;QACvB,cAAc,EAAEA,OAAO;QACvB,iBAAiB,EAAEC,MAAM;QAEzB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QAEd,IAAI,EAAE,QAAQ;KACf,AAAC;IACF,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAIhC,CAAA,sBAJgC,CAACL,UAAU,EAAE;QAC7CD,IAAI;QAEJO,UAAU,EAAE,IAAI;KACjB,CAAC,AAAC;IAEH,+BAA+B;IAC/B,sBAAsB;IAEtB,IAAIF,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBG,CAAAA,GAAAA,KAAS,AAmBR,CAAA,UAnBQ,CACP,CAAC,8BAA8B,CAAC,EAChC,CAAC,gBAAgB,CAAC,EAClB;YACE,CAAC,8EAA8E,CAAC;YAChF,CAAC,6DAA6D,CAAC;YAC/D,CAAC,gEAAgE,CAAC;YAClE,CAAC,gDAAgD,CAAC;YAClDC,MAAK,QAAA,CAAC,mGAAmG,CAAC;YAC1G,CAAC,wEAAwE,CAAC;YAC1EA,MAAK,QAAA,CAAC,wFAAwF,CAAC;YAC/F,CAAC,2CAA2C,CAAC;SAC9C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\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { XcodeConfiguration } from './XcodeBuild.types';\nimport { Command } from '../../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../../utils/args';\nimport { logCmdError } from '../../utils/errors';\n\nexport const expoRunIos: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--help': Boolean,\n '--no-build-cache': Boolean,\n '--no-install': Boolean,\n '--no-bundler': Boolean,\n '--configuration': String,\n\n '--port': Number,\n // Aliases\n '-p': '--port',\n\n '-h': '--help',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n\n permissive: true,\n });\n\n // '-d' -> '--device': Boolean,\n // '--scheme': String,\n\n if (args['--help']) {\n printHelp(\n `Run the iOS app binary locally`,\n `npx expo run:ios`,\n [\n `--no-build-cache Clear the native derived data before building`,\n `--no-install Skip installing dependencies`,\n `--no-bundler Skip starting the Metro bundler`,\n `--scheme [scheme] Scheme to build`,\n chalk`--configuration <configuration> Xcode configuration to use. Debug or Release. {dim Default: Debug}`,\n `-d, --device [device] Device name or UDID to build the app on`,\n chalk`-p, --port <port> Port to start the Metro bundler on. {dim Default: 8081}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Build for production (unsigned) with the {bold Release} configuration:`,\n chalk` {dim $} npx expo run:ios --configuration Release`,\n '',\n ].join('\\n')\n );\n }\n\n const { resolveStringOrBooleanArgsAsync } = await import('../../utils/resolveArgs');\n const parsed = await resolveStringOrBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--scheme': Boolean,\n '--device': Boolean,\n '-d': '--device',\n }).catch(logCmdError);\n\n const { runIosAsync } = await import('./runIosAsync');\n return runIosAsync(path.resolve(parsed.projectRoot), {\n // Parsed options\n buildCache: !args['--no-build-cache'],\n install: !args['--no-install'],\n bundler: !args['--no-bundler'],\n port: args['--port'],\n\n // Custom parsed args\n device: parsed.args['--device'],\n scheme: parsed.args['--scheme'],\n configuration: parsed.args['--configuration'] as XcodeConfiguration,\n }).catch(logCmdError);\n};\n"],"names":["expoRunIos","argv","rawArgsMap","Boolean","String","Number","args","assertWithOptionsArgs","permissive","printHelp","chalk","join","resolveStringOrBooleanArgsAsync","parsed","catch","logCmdError","runIosAsync","path","resolve","projectRoot","buildCache","install","bundler","port","device","scheme","configuration"],"mappings":"AAAA;;;;;;AAEkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAI0B,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AACvC,IAAA,OAAoB,WAApB,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,kBAAkB,EAAEA,OAAO;QAC3B,cAAc,EAAEA,OAAO;QACvB,cAAc,EAAEA,OAAO;QACvB,iBAAiB,EAAEC,MAAM;QAEzB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QAEd,IAAI,EAAE,QAAQ;KACf,AAAC;IACF,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAIhC,CAAA,sBAJgC,CAACL,UAAU,EAAE;QAC7CD,IAAI;QAEJO,UAAU,EAAE,IAAI;KACjB,CAAC,AAAC;IAEH,+BAA+B;IAC/B,sBAAsB;IAEtB,IAAIF,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBG,CAAAA,GAAAA,KAAS,AAmBR,CAAA,UAnBQ,CACP,CAAC,8BAA8B,CAAC,EAChC,CAAC,gBAAgB,CAAC,EAClB;YACE,CAAC,8EAA8E,CAAC;YAChF,CAAC,6DAA6D,CAAC;YAC/D,CAAC,gEAAgE,CAAC;YAClE,CAAC,gDAAgD,CAAC;YAClDC,MAAK,QAAA,CAAC,mGAAmG,CAAC;YAC1G,CAAC,wEAAwE,CAAC;Y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A,UAAU"}
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  exports.launchAppAsync = launchAppAsync;
6
6
  var _chalk = _interopRequireDefault(require("chalk"));
7
7
  var _path = _interopRequireDefault(require("path"));
8
+ var XcodeBuild = _interopRequireWildcard(require("./XcodeBuild"));
9
+ var _installOnDeviceAsync = require("./appleDevice/installOnDeviceAsync");
8
10
  var _appleDeviceManager = require("../../start/platforms/ios/AppleDeviceManager");
9
11
  var _simctlLogging = require("../../start/platforms/ios/simctlLogging");
10
12
  var _plist = require("../../utils/plist");
11
13
  var _profile = require("../../utils/profile");
12
- var XcodeBuild = _interopRequireWildcard(require("./XcodeBuild"));
13
- var _installOnDeviceAsync = require("./appleDevice/installOnDeviceAsync");
14
14
  function _interopRequireDefault(obj) {
15
15
  return obj && obj.__esModule ? obj : {
16
16
  default: obj
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/launchApp.ts"],"sourcesContent":["import chalk from 'chalk';\nimport path from 'path';\n\nimport { AppleDeviceManager } from '../../start/platforms/ios/AppleDeviceManager';\nimport { SimulatorLogStreamer } from '../../start/platforms/ios/simctlLogging';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { parsePlistAsync } from '../../utils/plist';\nimport { profile } from '../../utils/profile';\nimport * as XcodeBuild from './XcodeBuild';\nimport { BuildProps } from './XcodeBuild.types';\nimport { getAppDeltaDirectory, installOnDeviceAsync } from './appleDevice/installOnDeviceAsync';\n\n/** Install and launch the app binary on a device. */\nexport async function launchAppAsync(\n binaryPath: string,\n manager: DevServerManager,\n props: Pick<BuildProps, 'isSimulator' | 'device' | 'shouldStartBundler'>\n) {\n const appId = await profile(getBundleIdentifierForBinaryAsync)(binaryPath);\n\n if (!props.isSimulator) {\n await profile(installOnDeviceAsync)({\n bundleIdentifier: appId,\n bundle: binaryPath,\n appDeltaDirectory: getAppDeltaDirectory(appId),\n udid: props.device.udid,\n deviceName: props.device.name,\n });\n return;\n }\n\n XcodeBuild.logPrettyItem(chalk`{bold Installing} on ${props.device.name}`);\n\n const device = await AppleDeviceManager.resolveAsync({ device: props.device });\n await device.installAppAsync(binaryPath);\n\n XcodeBuild.logPrettyItem(chalk`{bold Opening} on ${device.name} {dim (${appId})}`);\n\n if (props.shouldStartBundler) {\n await SimulatorLogStreamer.getStreamer(device.device, {\n appId,\n }).attachAsync();\n }\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync(\n 'simulator',\n {\n applicationId: appId,\n },\n { device }\n );\n}\n\nasync function getBundleIdentifierForBinaryAsync(binaryPath: string): Promise<string> {\n const builtInfoPlistPath = path.join(binaryPath, 'Info.plist');\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n return CFBundleIdentifier;\n}\n"],"names":["launchAppAsync","XcodeBuild","binaryPath","manager","props","appId","profile","getBundleIdentifierForBinaryAsync","isSimulator","installOnDeviceAsync","bundleIdentifier","bundle","appDeltaDirectory","getAppDeltaDirectory","udid","device","deviceName","name","logPrettyItem","chalk","AppleDeviceManager","resolveAsync","installAppAsync","shouldStartBundler","SimulatorLogStreamer","getStreamer","attachAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","builtInfoPlistPath","path","join","CFBundleIdentifier","parsePlistAsync"],"mappings":"AAAA;;;;QAasBA,cAAc,GAAdA,cAAc;AAblB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEY,IAAA,mBAA8C,WAA9C,8CAA8C,CAAA;AAC5C,IAAA,cAAyC,WAAzC,yCAAyC,CAAA;AAE9C,IAAA,MAAmB,WAAnB,mBAAmB,CAAA;AAC3B,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AACjCC,IAAAA,UAAU,mCAAM,cAAc,EAApB;AAEqC,IAAA,qBAAoC,WAApC,oCAAoC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGxF,eAAeD,cAAc,CAClCE,UAAkB,EAClBC,OAAyB,EACzBC,KAAwE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ExB,KAAK;KACrB,EACD;QAAEU,MAAM;KAAE,CACX,CAAC;CACH;AAED,eAAeR,iCAAiC,CAACL,UAAkB,EAAmB;IACpF,MAAM4B,kBAAkB,GAAGC,KAAI,QAAA,CAACC,IAAI,CAAC9B,UAAU,EAAE,YAAY,CAAC,AAAC;IAC/D,MAAM,EAAE+B,kBAAkB,CAAA,EAAE,GAAG,MAAMC,CAAAA,GAAAA,MAAe,AAAoB,CAAA,gBAApB,CAACJ,kBAAkB,CAAC,AAAC;IACzE,OAAOG,kBAAkB,CAAC;CAC3B"}
1
+ {"version":3,"sources":["../../../../src/run/ios/launchApp.ts"],"sourcesContent":["import chalk from 'chalk';\nimport path from 'path';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { BuildProps } from './XcodeBuild.types';\nimport { getAppDeltaDirectory, installOnDeviceAsync } from './appleDevice/installOnDeviceAsync';\nimport { AppleDeviceManager } from '../../start/platforms/ios/AppleDeviceManager';\nimport { SimulatorLogStreamer } from '../../start/platforms/ios/simctlLogging';\nimport { DevServerManager } from '../../start/server/DevServerManager';\nimport { parsePlistAsync } from '../../utils/plist';\nimport { profile } from '../../utils/profile';\n\n/** Install and launch the app binary on a device. */\nexport async function launchAppAsync(\n binaryPath: string,\n manager: DevServerManager,\n props: Pick<BuildProps, 'isSimulator' | 'device' | 'shouldStartBundler'>\n) {\n const appId = await profile(getBundleIdentifierForBinaryAsync)(binaryPath);\n\n if (!props.isSimulator) {\n await profile(installOnDeviceAsync)({\n bundleIdentifier: appId,\n bundle: binaryPath,\n appDeltaDirectory: getAppDeltaDirectory(appId),\n udid: props.device.udid,\n deviceName: props.device.name,\n });\n return;\n }\n\n XcodeBuild.logPrettyItem(chalk`{bold Installing} on ${props.device.name}`);\n\n const device = await AppleDeviceManager.resolveAsync({ device: props.device });\n await device.installAppAsync(binaryPath);\n\n XcodeBuild.logPrettyItem(chalk`{bold Opening} on ${device.name} {dim (${appId})}`);\n\n if (props.shouldStartBundler) {\n await SimulatorLogStreamer.getStreamer(device.device, {\n appId,\n }).attachAsync();\n }\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync(\n 'simulator',\n {\n applicationId: appId,\n },\n { device }\n );\n}\n\nasync function getBundleIdentifierForBinaryAsync(binaryPath: string): Promise<string> {\n const builtInfoPlistPath = path.join(binaryPath, 'Info.plist');\n const { CFBundleIdentifier } = await parsePlistAsync(builtInfoPlistPath);\n return CFBundleIdentifier;\n}\n"],"names":["launchAppAsync","XcodeBuild","binaryPath","manager","props","appId","profile","getBundleIdentifierForBinaryAsync","isSimulator","installOnDeviceAsync","bundleIdentifier","bundle","appDeltaDirectory","getAppDeltaDirectory","udid","device","deviceName","name","logPrettyItem","chalk","AppleDeviceManager","resolveAsync","installAppAsync","shouldStartBundler","SimulatorLogStreamer","getStreamer","attachAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","builtInfoPlistPath","path","join","CFBundleIdentifier","parsePlistAsync"],"mappings":"AAAA;;;;QAasBA,cAAc,GAAdA,cAAc;AAblB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,UAAU,mCAAM,cAAc,EAApB;AAEqC,IAAA,qBAAoC,WAApC,oCAAoC,CAAA;AAC5D,IAAA,mBAA8C,WAA9C,8CAA8C,CAAA;AAC5C,IAAA,cAAyC,WAAzC,yCAAyC,CAAA;AAE9C,IAAA,MAAmB,WAAnB,mBAAmB,CAAA;AAC3B,IAAA,QAAqB,WAArB,qBAAqB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtC,eAAeD,cAAc,CAClCE,UAAkB,EAClBC,OAAyB,EACzBC,KAAwE,EACxE;IACA,MAAMC,KAAK,GAAG,MAAMC,CAAAA,GAAAA,QAAO,AAAmC,CAAA,QAAnC,CAACC,iCAAiC,CAAC,CAACL,UAAU,CAAC,AAAC;IAE3E,IAAI,CAACE,KAAK,CAACI,WAAW,EAAE;QACtB,MAAMF,CAAAA,GAAAA,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,MAAM,EAAE+B,kBAAkB,CAAA,EAAE,GAAG,MAAMC,CAAAA,GAAAA,MAAe,AAAoB,CAAA,gBAApB,CAACJ,kBAAkB,CAAC,AAAC;IACzE,OAAOG,kBAAkB,CAAC;CAC3B"}
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  exports.resolveDeviceAsync = resolveDeviceAsync;
6
6
  exports.isSimulatorDevice = isSimulatorDevice;
7
+ var _promptDevice = require("./promptDevice");
7
8
  var Log = _interopRequireWildcard(require("../../../log"));
8
9
  var _appleDeviceManager = require("../../../start/platforms/ios/AppleDeviceManager");
9
10
  var _assertSystemRequirements = require("../../../start/platforms/ios/assertSystemRequirements");
@@ -13,7 +14,6 @@ var _errors = require("../../../utils/errors");
13
14
  var _profile = require("../../../utils/profile");
14
15
  var _hints = require("../../hints");
15
16
  var AppleDevice = _interopRequireWildcard(require("../appleDevice/AppleDevice"));
16
- var _promptDevice = require("./promptDevice");
17
17
  function _interopRequireWildcard(obj) {
18
18
  if (obj && obj.__esModule) {
19
19
  return obj;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveDevice.ts"],"sourcesContent":["import * as Log from '../../../log';\nimport {\n AppleDeviceManager,\n ensureSimulatorOpenAsync,\n} from '../../../start/platforms/ios/AppleDeviceManager';\nimport { assertSystemRequirementsAsync } from '../../../start/platforms/ios/assertSystemRequirements';\nimport { sortDefaultDeviceToBeginningAsync } from '../../../start/platforms/ios/promptAppleDevice';\nimport { OSType } from '../../../start/platforms/ios/simctl';\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { logDeviceArgument } from '../../hints';\nimport * as AppleDevice from '../appleDevice/AppleDevice';\nimport { promptDeviceAsync } from './promptDevice';\n\ntype AnyDevice = SimControl.Device | AppleDevice.ConnectedDevice;\n\n/** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */\nasync function getDevicesAsync({ osType }: { osType?: OSType } = {}): Promise<AnyDevice[]> {\n const connectedDevices = await AppleDevice.getConnectedDevicesAsync();\n\n const simulators = await sortDefaultDeviceToBeginningAsync(\n await profile(SimControl.getDevicesAsync)(),\n osType\n );\n\n const devices = [...connectedDevices, ...simulators];\n\n // If osType is defined, then filter out ineligible simulators.\n // Only do this inside of the device selection so users who pass the entire device udid can attempt to select any simulator (even if it's invalid).\n return osType ? filterDevicesForOsType(devices, osType) : devices;\n}\n\n/** @returns a list of devices, filtered by the provided `osType`. */\nfunction filterDevicesForOsType(devices: AnyDevice[], osType: OSType): AnyDevice[] {\n return devices.filter((device) => !('osType' in device) || device.osType === osType);\n}\n\n/** Given a `device` argument from the CLI, parse and prompt our way to a usable device for building. */\nexport async function resolveDeviceAsync(\n device?: string | boolean,\n { osType }: { osType?: OSType } = {}\n): Promise<AnyDevice> {\n await assertSystemRequirementsAsync();\n\n if (!device) {\n /** Finds the first possible device and returns in a booted state. */\n const manager = await AppleDeviceManager.resolveAsync({\n device: {\n osType,\n },\n });\n Log.debug(\n `Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${osType})`\n );\n return manager.device;\n }\n\n const devices: AnyDevice[] = await getDevicesAsync({\n osType,\n });\n\n const resolved =\n device === true\n ? // `--device` (no props after)\n await promptDeviceAsync(devices)\n : // `--device <name|udid>`\n findDeviceFromSearchValue(devices, device.toLowerCase());\n\n return ensureBootedAsync(resolved);\n}\n\n/** @returns `true` if the given device is a simulator. */\nexport function isSimulatorDevice(device: AnyDevice): boolean {\n return (\n !('deviceType' in device) ||\n device.deviceType.startsWith('com.apple.CoreSimulator.SimDeviceType.')\n );\n}\n\n/** @returns device matching the `searchValue` against name or UDID. */\nfunction findDeviceFromSearchValue(devices: AnyDevice[], searchValue: string): AnyDevice {\n const device = devices.find(\n (device) =>\n device.udid.toLowerCase() === searchValue || device.name.toLowerCase() === searchValue\n );\n if (!device) {\n throw new CommandError('BAD_ARGS', `No device UDID or name matching \"${searchValue}\"`);\n }\n return device;\n}\n\n/** Ensures the device is booted if it's a simulator. */\nasync function ensureBootedAsync(device: AnyDevice): Promise<AnyDevice> {\n // --device with no props after\n logDeviceArgument(device.udid);\n if (isSimulatorDevice(device)) {\n return ensureSimulatorOpenAsync({ udid: device.udid });\n }\n return device;\n}\n"],"names":["resolveDeviceAsync","isSimulatorDevice","Log","SimControl","AppleDevice","getDevicesAsync","osType","connectedDevices","getConnectedDevicesAsync","simulators","sortDefaultDeviceToBeginningAsync","profile","devices","filterDevicesForOsType","filter","device","assertSystemRequirementsAsync","manager","AppleDeviceManager","resolveAsync","debug","name","udid","resolved","promptDeviceAsync","findDeviceFromSearchValue","toLowerCase","ensureBootedAsync","deviceType","startsWith","searchValue","find","CommandError","logDeviceArgument","ensureSimulatorOpenAsync"],"mappings":"AAAA;;;;QAuCsBA,kBAAkB,GAAlBA,kBAAkB;QAkCxBC,iBAAiB,GAAjBA,iBAAiB;AAzErBC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AAIR,IAAA,mBAAiD,WAAjD,iDAAiD,CAAA;AACV,IAAA,yBAAuD,WAAvD,uDAAuD,CAAA;AACnD,IAAA,kBAAgD,WAAhD,gDAAgD,CAAA;AAEtFC,IAAAA,UAAU,mCAAM,qCAAqC,EAA3C;AACO,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AAC5B,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACd,IAAA,MAAa,WAAb,aAAa,CAAA;AACnCC,IAAAA,WAAW,mCAAM,4BAA4B,EAAlC;AACW,IAAA,aAAgB,WAAhB,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAIlD,yHAAyH,CACzH,eAAeC,eAAe,CAAC,EAAEC,MAAM,CAAA,EAAuB,GAAG,EAAE,EAAwB;IACzF,MAAMC,gBAAgB,GAAG,MAAMH,WAAW,CAACI,wBAAwB,EAAE,AAAC;IAEtE,MAAMC,UAAU,GAAG,MAAMC,CAAAA,GAAA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,GAEX,MAAMS,CAAAA,GAAAA,aAAiB,AAAS,CAAA,kBAAT,CAACZ,OAAO,CAAC,GAEhCa,yBAAyB,CAACb,OAAO,EAAEG,MAAM,CAACW,WAAW,EAAE,CAAC,AAAC;IAE/D,OAAOC,iBAAiB,CAACJ,QAAQ,CAAC,CAAC;CACpC;AAGM,SAAStB,iBAAiB,CAACc,MAAiB,EAAW;IAC5D,OACE,CAAC,CAAC,YAAY,IAAIA,MAAM,CAAC,IACzBA,MAAM,CAACa,UAAU,CAACC,UAAU,CAAC,wCAAwC,CAAC,CACtE;CACH;AAED,uEAAuE,CACvE,SAASJ,yBAAyB,CAACb,OAAoB,EAAEkB,WAAmB,EAAa;IACvF,MAAMf,OAAM,GAAGH,OAAO,CAACmB,IAAI,CACzB,CAAChB,MAAM,GACLA,MAAM,CAACO,IAAI,CAACI,WAAW,EAAE,KAAKI,WAAW,IAAIf,MAAM,CAACM,IAAI,CAACK,WAAW,EAAE,KAAKI,WAAW;IAAA,CACzF,AAAC;IACF,IAAI,CAACf,OAAM,EAAE;QACX,MAAM,IAAIiB,OAAY,aAAA,CAAC,UAAU,EAAE,CAAC,iCAAiC,EAAEF,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;KACxF;IACD,OAAOf,OAAM,CAAC;CACf;AAED,wDAAwD,CACxD,eAAeY,iBAAiB,CAACZ,MAAiB,EAAsB;IACtE,+BAA+B;IAC/BkB,CAAAA,GAAAA,MAAiB,AAAa,CAAA,kBAAb,CAAClB,MAAM,CAACO,IAAI,CAAC,CAAC;IAC/B,IAAIrB,iBAAiB,CAACc,MAAM,CAAC,EAAE;QAC7B,OAAOmB,CAAAA,GAAAA,mBAAwB,AAAuB,CAAA,yBAAvB,CAAC;YAAEZ,IAAI,EAAEP,MAAM,CAACO,IAAI;SAAE,CAAC,CAAC;KACxD;IACD,OAAOP,MAAM,CAAC;CACf"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveDevice.ts"],"sourcesContent":["import { promptDeviceAsync } from './promptDevice';\nimport * as Log from '../../../log';\nimport {\n AppleDeviceManager,\n ensureSimulatorOpenAsync,\n} from '../../../start/platforms/ios/AppleDeviceManager';\nimport { assertSystemRequirementsAsync } from '../../../start/platforms/ios/assertSystemRequirements';\nimport { sortDefaultDeviceToBeginningAsync } from '../../../start/platforms/ios/promptAppleDevice';\nimport { OSType } from '../../../start/platforms/ios/simctl';\nimport * as SimControl from '../../../start/platforms/ios/simctl';\nimport { CommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { logDeviceArgument } from '../../hints';\nimport * as AppleDevice from '../appleDevice/AppleDevice';\n\ntype AnyDevice = SimControl.Device | AppleDevice.ConnectedDevice;\n\n/** Get a list of devices (called destinations) that are connected to the host machine. Filter by `osType` if defined. */\nasync function getDevicesAsync({ osType }: { osType?: OSType } = {}): Promise<AnyDevice[]> {\n const connectedDevices = await AppleDevice.getConnectedDevicesAsync();\n\n const simulators = await sortDefaultDeviceToBeginningAsync(\n await profile(SimControl.getDevicesAsync)(),\n osType\n );\n\n const devices = [...connectedDevices, ...simulators];\n\n // If osType is defined, then filter out ineligible simulators.\n // Only do this inside of the device selection so users who pass the entire device udid can attempt to select any simulator (even if it's invalid).\n return osType ? filterDevicesForOsType(devices, osType) : devices;\n}\n\n/** @returns a list of devices, filtered by the provided `osType`. */\nfunction filterDevicesForOsType(devices: AnyDevice[], osType: OSType): AnyDevice[] {\n return devices.filter((device) => !('osType' in device) || device.osType === osType);\n}\n\n/** Given a `device` argument from the CLI, parse and prompt our way to a usable device for building. */\nexport async function resolveDeviceAsync(\n device?: string | boolean,\n { osType }: { osType?: OSType } = {}\n): Promise<AnyDevice> {\n await assertSystemRequirementsAsync();\n\n if (!device) {\n /** Finds the first possible device and returns in a booted state. */\n const manager = await AppleDeviceManager.resolveAsync({\n device: {\n osType,\n },\n });\n Log.debug(\n `Resolved default device (name: ${manager.device.name}, udid: ${manager.device.udid}, osType: ${osType})`\n );\n return manager.device;\n }\n\n const devices: AnyDevice[] = await getDevicesAsync({\n osType,\n });\n\n const resolved =\n device === true\n ? // `--device` (no props after)\n await promptDeviceAsync(devices)\n : // `--device <name|udid>`\n findDeviceFromSearchValue(devices, device.toLowerCase());\n\n return ensureBootedAsync(resolved);\n}\n\n/** @returns `true` if the given device is a simulator. */\nexport function isSimulatorDevice(device: AnyDevice): boolean {\n return (\n !('deviceType' in device) ||\n device.deviceType.startsWith('com.apple.CoreSimulator.SimDeviceType.')\n );\n}\n\n/** @returns device matching the `searchValue` against name or UDID. */\nfunction findDeviceFromSearchValue(devices: AnyDevice[], searchValue: string): AnyDevice {\n const device = devices.find(\n (device) =>\n device.udid.toLowerCase() === searchValue || device.name.toLowerCase() === searchValue\n );\n if (!device) {\n throw new CommandError('BAD_ARGS', `No device UDID or name matching \"${searchValue}\"`);\n }\n return device;\n}\n\n/** Ensures the device is booted if it's a simulator. */\nasync function ensureBootedAsync(device: AnyDevice): Promise<AnyDevice> {\n // --device with no props after\n logDeviceArgument(device.udid);\n if (isSimulatorDevice(device)) {\n return ensureSimulatorOpenAsync({ udid: device.udid });\n }\n return device;\n}\n"],"names":["resolveDeviceAsync","isSimulatorDevice","Log","SimControl","AppleDevice","getDevicesAsync","osType","connectedDevices","getConnectedDevicesAsync","simulators","sortDefaultDeviceToBeginningAsync","profile","devices","filterDevicesForOsType","filter","device","assertSystemRequirementsAsync","manager","AppleDeviceManager","resolveAsync","debug","name","udid","resolved","promptDeviceAsync","findDeviceFromSearchValue","toLowerCase","ensureBootedAsync","deviceType","startsWith","searchValue","find","CommandError","logDeviceArgument","ensureSimulatorOpenAsync"],"mappings":"AAAA;;;;QAuCsBA,kBAAkB,GAAlBA,kBAAkB;QAkCxBC,iBAAiB,GAAjBA,iBAAiB;AAzEC,IAAA,aAAgB,WAAhB,gBAAgB,CAAA;AACtCC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AAIR,IAAA,mBAAiD,WAAjD,iDAAiD,CAAA;AACV,IAAA,yBAAuD,WAAvD,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AC,CAAC,CAAC;KACxF;IACD,OAAOf,OAAM,CAAC;CACf;AAED,wDAAwD,CACxD,eAAeY,iBAAiB,CAACZ,MAAiB,EAAsB;IACtE,+BAA+B;IAC/BkB,CAAAA,GAAAA,MAAiB,AAAa,CAAA,kBAAb,CAAClB,MAAM,CAACO,IAAI,CAAC,CAAC;IAC/B,IAAIrB,iBAAiB,CAACc,MAAM,CAAC,EAAE;QAC7B,OAAOmB,CAAAA,GAAAA,mBAAwB,AAAuB,CAAA,yBAAvB,CAAC;YAAEZ,IAAI,EAAEP,MAAM,CAACO,IAAI;SAAE,CAAC,CAAC;KACxD;IACD,OAAOP,MAAM,CAAC;CACf"}
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.resolveOptionsAsync = resolveOptionsAsync;
6
- var _simctl = require("../../../start/platforms/ios/simctl");
7
- var _resolveBundlerProps = require("../../resolveBundlerProps");
8
6
  var _resolveDevice = require("./resolveDevice");
9
7
  var _resolveNativeScheme = require("./resolveNativeScheme");
10
8
  var _resolveXcodeProject = require("./resolveXcodeProject");
9
+ var _simctl = require("../../../start/platforms/ios/simctl");
10
+ var _resolveBundlerProps = require("../../resolveBundlerProps");
11
11
  async function resolveOptionsAsync(projectRoot, options) {
12
12
  const xcodeProject = (0, _resolveXcodeProject).resolveXcodeProject(projectRoot);
13
13
  const bundlerProps = await (0, _resolveBundlerProps).resolveBundlerPropsAsync(projectRoot, options);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isOSType } from '../../../start/platforms/ios/simctl';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\nimport { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await resolveDeviceAsync(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","device","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","configuration","shouldSkipInitialBundling","buildCache"],"mappings":"AAAA;;;;QAQsBA,mBAAmB,GAAnBA,mBAAmB;AARhB,IAAA,OAAqC,WAArC,qCAAqC,CAAA;AACrB,IAAA,oBAA2B,WAA3B,2BAA2B,CAAA;AAEd,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AACzB,IAAA,oBAAuB,WAAvB,uBAAuB,CAAA;AACjC,IAAA,oBAAuB,WAAvB,uBAA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;KACP,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../../src/run/ios/options/resolveOptions.ts"],"sourcesContent":["import { isSimulatorDevice, resolveDeviceAsync } from './resolveDevice';\nimport { resolveNativeSchemePropsAsync } from './resolveNativeScheme';\nimport { resolveXcodeProject } from './resolveXcodeProject';\nimport { isOSType } from '../../../start/platforms/ios/simctl';\nimport { resolveBundlerPropsAsync } from '../../resolveBundlerProps';\nimport { BuildProps, Options } from '../XcodeBuild.types';\n\n/** Resolve arguments for the `run:ios` command. */\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<BuildProps> {\n const xcodeProject = resolveXcodeProject(projectRoot);\n\n const bundlerProps = await resolveBundlerPropsAsync(projectRoot, options);\n\n // Resolve the scheme before the device so we can filter devices based on\n // whichever scheme is selected (i.e. don't present TV devices if the scheme cannot be run on a TV).\n const { osType, name: scheme } = await resolveNativeSchemePropsAsync(\n projectRoot,\n options,\n xcodeProject\n );\n\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n const device = await resolveDeviceAsync(options.device, {\n // It's unclear if there's any value to asserting that we haven't hardcoded the os type in the CLI.\n osType: isOSType(osType) ? osType : undefined,\n });\n\n const isSimulator = isSimulatorDevice(device);\n\n // Use the configuration or `Debug` if none is provided.\n const configuration = options.configuration || 'Debug';\n\n // This optimization skips resetting the Metro cache needlessly.\n // The cache is reset in `../node_modules/react-native/scripts/react-native-xcode.sh` when the\n // project is running in Debug and built onto a physical device. It seems that this is done because\n // the script is run from Xcode and unaware of the CLI instance.\n const shouldSkipInitialBundling = configuration === 'Debug' && !isSimulator;\n\n return {\n ...bundlerProps,\n projectRoot,\n isSimulator,\n xcodeProject,\n device,\n configuration,\n shouldSkipInitialBundling,\n buildCache: options.buildCache !== false,\n scheme,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","xcodeProject","resolveXcodeProject","bundlerProps","resolveBundlerPropsAsync","osType","name","scheme","resolveNativeSchemePropsAsync","device","resolveDeviceAsync","isOSType","undefined","isSimulator","isSimulatorDevice","configuration","shouldSkipInitialBundling","buildCache"],"mappings":"AAAA;;;;QAQsBA,mBAAmB,GAAnBA,mBAAmB;AARa,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AACzB,IAAA,oBAAuB,WAAvB,uBAAuB,CAAA;AACjC,IAAA,oBAAuB,WAAvB,uBAAuB,CAAA;AAClC,IAAA,OAAqC,WAArC,qCAAqC,CAAA;AACrB,IAAA,oBAA2B,WAA3B,2BAA2B,CAAA;AAI7D,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAgB,EACK;IACrB,MAAMC,YAAY,GAAGC,CAAAA,GAAAA,oBAAmB,AAAa,CAAA,oBAAb,CAACH,WAAW,CAAC,AAAC;IAEtD,MAAMI,YAAY,GAAG,MAAMC,CAAAA,GAAAA,oBAAwB,AAAsB,CAAA,yBAAtB,CAACL,WAAW,EAAEC,OAAO,CAAC,AAAC;IAE1E,yEAAyE;IACzE,oGAAoG;IACpG,MAAM,EAAEK,MAAM,CAAA,EAAEC,IAAI,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMC,CAAAA,GAAAA,oBAA6B,AAInE,CAAA,8BAJmE,CAClET,WAAW,EACXC,OAAO,EACPC,YAAY,CACb,AAAC;IAEF,+DAA+D;IAC/D,mFAAmF;IACnF,MAAMQ,MAAM,GAAG,MAAMC,CAAAA,GAAAA,cAAkB,AAGrC,CAAA,mBAHqC,CAACV,OAAO,CAACS,MAAM,EAAE;QACtD,mGAAmG;QACnGJ,MAAM,EAAEM,CAAAA,GAAAA,OAAQ,AAAQ,CAAA,SAAR,CAACN,MAAM,CAAC,GAAGA,MAAM,GAAGO,SAAS;KAC9C,CAAC,AAAC;IAEH,MAAMC,WAAW,GAAGC,CAAAA,GAAAA,cAAiB,AAAQ,CAAA,kBAAR,CAACL,MAAM,CAAC,AAAC;IAE9C,wDAAwD;IACxD,MAAMM,aAAa,GAAGf,OAAO,CAACe,aAAa,IAAI,OAAO,AAAC;IAEvD,gEAAgE;IAChE,8FAA8F;IAC9F,mGAAmG;IACnG,gEAAgE;IAChE,MAAMC,yBAAyB,GAAGD,aAAa,KAAK,OAAO,IAAI,CAACF,WAAW,AAAC;IAE5E,OAAO;QACL,GAAGV,YAAY;QACfJ,WAAW;QACXc,WAAW;QACXZ,YAAY;QACZQ,MAAM;QACNM,aAAa;QACbC,yBAAyB;QACzBC,UAAU,EAAEjB,OAAO,CAACiB,UAAU,KAAK,KAAK;QACxCV,MAAM;KACP,CAAC;CACH"}
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  exports.runIosAsync = runIosAsync;
6
6
  var _chalk = _interopRequireDefault(require("chalk"));
7
+ var XcodeBuild = _interopRequireWildcard(require("./XcodeBuild"));
8
+ var _launchApp = require("./launchApp");
9
+ var _resolveOptions = require("./options/resolveOptions");
7
10
  var Log = _interopRequireWildcard(require("../../log"));
8
11
  var _cocoapods = require("../../utils/cocoapods");
9
12
  var _nodeEnv = require("../../utils/nodeEnv");
@@ -12,9 +15,6 @@ var _scheme = require("../../utils/scheme");
12
15
  var _ensureNativeProject = require("../ensureNativeProject");
13
16
  var _hints = require("../hints");
14
17
  var _startBundler = require("../startBundler");
15
- var XcodeBuild = _interopRequireWildcard(require("./XcodeBuild"));
16
- var _launchApp = require("./launchApp");
17
- var _resolveOptions = require("./options/resolveOptions");
18
18
  function _interopRequireDefault(obj) {
19
19
  return obj && obj.__esModule ? obj : {
20
20
  default: obj
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","Log","XcodeBuild","projectRoot","options","setNodeEnv","configuration","require","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","buildAsync","binaryPath","profile","getAppBinaryPath","manager","startBundlerAsync","port","headless","shouldStartBundler","scheme","getSchemesForIosAsync","launchAppAsync","isSimulator","device","logProject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AC,CACvG,CAAC;KACH;CACF"}
1
+ {"version":3,"sources":["../../../../src/run/ios/runIosAsync.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as XcodeBuild from './XcodeBuild';\nimport { Options } from './XcodeBuild.types';\nimport { launchAppAsync } from './launchApp';\nimport { resolveOptionsAsync } from './options/resolveOptions';\nimport * as Log from '../../log';\nimport { maybePromptToSyncPodsAsync } from '../../utils/cocoapods';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { getSchemesForIosAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\n\nexport async function runIosAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.configuration === 'Release' ? 'production' : 'development');\n require('@expo/env').load(projectRoot);\n\n assertPlatform();\n\n const install = !!options.install;\n\n if ((await ensureNativeProjectAsync(projectRoot, { platform: 'ios', install })) && install) {\n await maybePromptToSyncPodsAsync(projectRoot);\n }\n\n // Resolve the CLI arguments into useable options.\n const props = await resolveOptionsAsync(projectRoot, options);\n\n // Spawn the `xcodebuild` process to create the app binary.\n const buildOutput = await XcodeBuild.buildAsync(props);\n\n // Find the path to the built app binary, this will be used to install the binary\n // on a device.\n const binaryPath = await profile(XcodeBuild.getAppBinaryPath)(buildOutput);\n\n // Start the dev server which creates all of the required info for\n // launching the app on a simulator.\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForIosAsync(projectRoot))?.[0],\n });\n\n // Install and launch the app binary on a device.\n await launchAppAsync(binaryPath, manager, {\n isSimulator: props.isSimulator,\n device: props.device,\n shouldStartBundler: props.shouldStartBundler,\n });\n\n // Log the location of the JS logs for the device.\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nfunction assertPlatform() {\n if (process.platform !== 'darwin') {\n Log.exit(\n chalk`iOS apps can only be built on macOS devices. Use {cyan eas build -p ios} to build in the cloud.`\n );\n }\n}\n"],"names":["runIosAsync","XcodeBuild","Log","projectRoot","options","setNodeEnv","configuration","require","load","assertPlatform","install","ensureNativeProjectAsync","platform","maybePromptToSyncPodsAsync","props","resolveOptionsAsync","buildOutput","buildAsync","binaryPath","profile","getAppBinaryPath","manager","startBundlerAsync","port","headless","shouldStartBundler","scheme","getSchemesForIosAsync","launchAppAsync","isSimulator","device","logProjectLogsLocation","process","exit","chalk"],"mappings":"AAAA;;;;QAesBA,WAAW,GAAXA,WAAW;AAff,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,UAAU,mCAAM,cAAc,EAApB;AAES,IAAA,UAAa,WAAb,aAAa,CAAA;AACR,IAAA,eAA0B,WAA1B,0BAA0B,CAAA;AAClDC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AAC4B,IAAA,UAAuB,WAAvB,uBAAuB,CAAA;AACvC,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AACxB,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AACP,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AACjB,IAAA,oBAAwB,WAAxB,wBAAwB,CAAA;AAC1B,IAAA,MAAU,WAAV,UAAU,CAAA;AACf,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5C,eAAeF,WAAW,CAACG,WAAmB,EAAEC,OAAgB,EAAE;QA4B7D,GAA0C;IA3BpDC,CAAAA,GAAAA,QAAU,AAAoE,CAAA,WAApE,CAACD,OAAO,CAACE,aAAa,KAAK,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC;IAC/EC,OAAO,CAAC,WAAW,CAAC,CAACC,IAAI,CAACL,WAAW,CAAC,CAAC;IAEvCM,cAAc,EAAE,CAAC;IAEjB,MAAMC,OAAO,GAAG,CAAC,CAACN,OAAO,CAACM,OAAO,AAAC;IAElC,IAAI,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KAAK,CAACW,kBAAkB;KAC7C,CAAC,CAAC;IAEH,kDAAkD;IAClD,IAAIX,KAAK,CAACW,kBAAkB,EAAE;QAC5BM,CAAAA,GAAAA,MAAsB,AAAE,CAAA,uBAAF,EAAE,CAAC;KAC1B;CACF;AAED,SAAStB,cAAc,GAAG;IACxB,IAAIuB,OAAO,CAACpB,QAAQ,KAAK,QAAQ,EAAE;QACjCV,GAAG,CAAC+B,IAAI,CACNC,MAAK,QAAA,CAAC,+FAA+F,CAAC,CACvG,CAAC;KACH;CACF"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  exports.getXcodeVersionAsync = void 0;
6
+ var _chalk = _interopRequireDefault(require("chalk"));
6
7
  var _childProcess = require("child_process");
7
8
  var _semver = _interopRequireDefault(require("semver"));
8
9
  var Log = _interopRequireWildcard(require("../../../log"));
@@ -37,8 +38,9 @@ function _interopRequireWildcard(obj) {
37
38
  }
38
39
  }
39
40
  const debug = require("debug")("expo:doctor:apple:xcode");
40
- // Based on the RN docs (Aug 2020).
41
- const MIN_XCODE_VERSION = 9.4;
41
+ // Based on the Apple announcement (last updated: Aug 2023).
42
+ // https://developer.apple.com/news/upcoming-requirements/?id=04252023a
43
+ const MIN_XCODE_VERSION = "14.1";
42
44
  const APP_STORE_ID = "497799835";
43
45
  const SUGGESTED_XCODE_VERSION = `${MIN_XCODE_VERSION}.0`;
44
46
  const promptToOpenAppStoreAsync = async (message)=>{
@@ -93,6 +95,20 @@ function getAppStoreLink(appId) {
93
95
  }
94
96
  return `https://apps.apple.com/us/app/id${appId}`;
95
97
  }
98
+ function spawnForString(cmd) {
99
+ try {
100
+ return (0, _childProcess).execSync(cmd, {
101
+ stdio: "pipe"
102
+ }).toString().trim();
103
+ } catch {}
104
+ return null;
105
+ }
106
+ /** @returns a string like `/Applications/Xcode.app/Contents/Developer` when Xcode has a correctly selected path. */ function getXcodeSelectPathAsync() {
107
+ return spawnForString("/usr/bin/xcode-select --print-path");
108
+ }
109
+ function getXcodeInstalled() {
110
+ return spawnForString("ls /Applications/Xcode.app/Contents/Developer");
111
+ }
96
112
  class XcodePrerequisite extends _prerequisite.Prerequisite {
97
113
  static instance = new XcodePrerequisite();
98
114
  /**
@@ -101,6 +117,31 @@ class XcodePrerequisite extends _prerequisite.Prerequisite {
101
117
  const version = (0, _profile).profile(getXcodeVersionAsync)();
102
118
  debug(`Xcode version: ${version}`);
103
119
  if (!version) {
120
+ // A couple different issues could have occurred, let's check them after we're past the point of no return
121
+ // since we no longer need to be fast about validation.
122
+ // Ensure Xcode.app can be found before we prompt to sudo select it.
123
+ if (getXcodeInstalled()) {
124
+ const selectPath = (0, _profile).profile(getXcodeSelectPathAsync)();
125
+ debug(`Xcode select path: ${selectPath}`);
126
+ if (!selectPath) {
127
+ Log.error([
128
+ "",
129
+ _chalk.default.bold("Xcode has not been fully setup for Apple development yet."),
130
+ "Download at: https://developer.apple.com/xcode/",
131
+ "or in the App Store.",
132
+ "",
133
+ "After downloading Xcode, run the following two commands in your terminal:",
134
+ _chalk.default.cyan(" sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer"),
135
+ _chalk.default.cyan(" sudo xcodebuild -runFirstLaunch"),
136
+ "",
137
+ "Then you can re-run Expo CLI. Alternatively, you can build apps in the cloud with EAS CLI, or preview using the Expo Go app on a physical device.",
138
+ "",
139
+ ].join("\n"));
140
+ throw new _errors.AbortCommandError();
141
+ } else {
142
+ debug(`Unexpected Xcode setup (version: ${version}, select: ${selectPath})`);
143
+ }
144
+ }
104
145
  // Almost certainly Xcode isn't installed.
105
146
  await promptToOpenAppStoreAsync(`Xcode must be fully installed before you can continue. Continue to the App Store?`);
106
147
  throw new _errors.AbortCommandError();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/doctor/apple/XcodePrerequisite.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { AbortCommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { confirmAsync } from '../../../utils/prompts';\nimport { Prerequisite } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:xcode') as typeof console.log;\n\n// Based on the RN docs (Aug 2020).\nconst MIN_XCODE_VERSION = 9.4;\nconst APP_STORE_ID = '497799835';\n\nconst SUGGESTED_XCODE_VERSION = `${MIN_XCODE_VERSION}.0`;\n\nconst promptToOpenAppStoreAsync = async (message: string) => {\n // This prompt serves no purpose accept informing the user what to do next, we could just open the App Store but it could be confusing if they don't know what's going on.\n const confirm = await confirmAsync({ initial: true, message });\n if (confirm) {\n Log.log(`Going to the App Store, re-run Expo CLI when Xcode has finished installing.`);\n openAppStore(APP_STORE_ID);\n }\n};\n\n/** Exposed for testing, use `getXcodeVersion` */\nexport const getXcodeVersionAsync = (): string | null | false => {\n try {\n const last = execSync('xcodebuild -version', { stdio: 'pipe' })\n .toString()\n .match(/^Xcode (\\d+\\.\\d+)/)?.[1];\n // Convert to a semver string\n if (last) {\n const version = `${last}.0`;\n\n if (!semver.valid(version)) {\n // Not sure why this would happen, if it does we should add a more confident error message.\n Log.error(`Xcode version is in an unknown format: ${version}`);\n return false;\n }\n\n return version;\n }\n // not sure what's going on\n Log.error(\n 'Unable to check Xcode version. Command ran successfully but no version number was found.'\n );\n } catch {\n // not installed\n }\n return null;\n};\n\n/**\n * Open a link to the App Store. Just link in mobile apps, **never** redirect without prompting first.\n *\n * @param appId\n */\nfunction openAppStore(appId: string) {\n const link = getAppStoreLink(appId);\n execSync(`open ${link}`, { stdio: 'ignore' });\n}\n\nfunction getAppStoreLink(appId: string): string {\n if (process.platform === 'darwin') {\n // TODO: Is there ever a case where the macappstore isn't available on mac?\n return `macappstore://itunes.apple.com/app/id${appId}`;\n }\n return `https://apps.apple.com/us/app/id${appId}`;\n}\n\nexport class XcodePrerequisite extends Prerequisite {\n static instance = new XcodePrerequisite();\n\n /**\n * Ensure Xcode is installed and recent enough to be used with Expo.\n */\n async assertImplementation(): Promise<void> {\n const version = profile(getXcodeVersionAsync)();\n debug(`Xcode version: ${version}`);\n if (!version) {\n // Almost certainly Xcode isn't installed.\n await promptToOpenAppStoreAsync(\n `Xcode must be fully installed before you can continue. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n\n if (semver.lt(version, SUGGESTED_XCODE_VERSION)) {\n // Xcode version is too old.\n await promptToOpenAppStoreAsync(\n `Xcode (${version}) needs to be updated to at least version ${MIN_XCODE_VERSION}. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n }\n}\n"],"names":["Log","debug","require","MIN_XCODE_VERSION","APP_STORE_ID","SUGGESTED_XCODE_VERSION","promptToOpenAppStoreAsync","message","confirm","confirmAsync","initial","log","openAppStore","getXcodeVersionAsync","execSync","last","stdio","toString","match","version","semver","valid","error","appId","link","getAppStoreLink","process","platform","XcodePrerequisite","Prerequisite","instance","assertImplementation","profile","AbortCommandError","lt"],"mappings":"AAAA;;;;;AAAyB,IAAA,aAAe,WAAf,eAAe,CAAA;AACrB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AAEfA,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACmB,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACjC,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACnB,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACxB,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,AAAsB,AAAC;AAEhF,mCAAmC;AACnC,MAAMC,iBAAiB,GAAG,GAAG,AAAC;AAC9B,MAAMC,YAAY,GAAG,WAAW,AAAC;AAEjC,MAAMC,uBAAuB,GAAG,CAAC,EAAEF,iBAAiB,CAAC,EAAE,CAAC,AAAC;AAEzD,MAAMG,yBAAyB,GAAG,OAAOC,OAAe,GAAK;IAC3D,0KAA0K;IAC1K,MAAMC,O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Sync } from 'child_process';\nimport semver from 'semver';\n\nimport * as Log from '../../../log';\nimport { AbortCommandError } from '../../../utils/errors';\nimport { profile } from '../../../utils/profile';\nimport { confirmAsync } from '../../../utils/prompts';\nimport { Prerequisite } from '../Prerequisite';\n\nconst debug = require('debug')('expo:doctor:apple:xcode') as typeof console.log;\n\n// Based on the Apple announcement (last updated: Aug 2023).\n// https://developer.apple.com/news/upcoming-requirements/?id=04252023a\nconst MIN_XCODE_VERSION = '14.1';\nconst APP_STORE_ID = '497799835';\n\nconst SUGGESTED_XCODE_VERSION = `${MIN_XCODE_VERSION}.0`;\n\nconst promptToOpenAppStoreAsync = async (message: string) => {\n // This prompt serves no purpose accept informing the user what to do next, we could just open the App Store but it could be confusing if they don't know what's going on.\n const confirm = await confirmAsync({ initial: true, message });\n if (confirm) {\n Log.log(`Going to the App Store, re-run Expo CLI when Xcode has finished installing.`);\n openAppStore(APP_STORE_ID);\n }\n};\n\n/** Exposed for testing, use `getXcodeVersion` */\nexport const getXcodeVersionAsync = (): string | null | false => {\n try {\n const last = execSync('xcodebuild -version', { stdio: 'pipe' })\n .toString()\n .match(/^Xcode (\\d+\\.\\d+)/)?.[1];\n // Convert to a semver string\n if (last) {\n const version = `${last}.0`;\n\n if (!semver.valid(version)) {\n // Not sure why this would happen, if it does we should add a more confident error message.\n Log.error(`Xcode version is in an unknown format: ${version}`);\n return false;\n }\n\n return version;\n }\n // not sure what's going on\n Log.error(\n 'Unable to check Xcode version. Command ran successfully but no version number was found.'\n );\n } catch {\n // not installed\n }\n return null;\n};\n\n/**\n * Open a link to the App Store. Just link in mobile apps, **never** redirect without prompting first.\n *\n * @param appId\n */\nfunction openAppStore(appId: string) {\n const link = getAppStoreLink(appId);\n execSync(`open ${link}`, { stdio: 'ignore' });\n}\n\nfunction getAppStoreLink(appId: string): string {\n if (process.platform === 'darwin') {\n // TODO: Is there ever a case where the macappstore isn't available on mac?\n return `macappstore://itunes.apple.com/app/id${appId}`;\n }\n return `https://apps.apple.com/us/app/id${appId}`;\n}\n\nfunction spawnForString(cmd: string): string | null {\n try {\n return execSync(cmd, { stdio: 'pipe' }).toString().trim();\n } catch {}\n return null;\n}\n\n/** @returns a string like `/Applications/Xcode.app/Contents/Developer` when Xcode has a correctly selected path. */\nfunction getXcodeSelectPathAsync() {\n return spawnForString('/usr/bin/xcode-select --print-path');\n}\nfunction getXcodeInstalled() {\n return spawnForString('ls /Applications/Xcode.app/Contents/Developer');\n}\n\nexport class XcodePrerequisite extends Prerequisite {\n static instance = new XcodePrerequisite();\n\n /**\n * Ensure Xcode is installed and recent enough to be used with Expo.\n */\n async assertImplementation(): Promise<void> {\n const version = profile(getXcodeVersionAsync)();\n debug(`Xcode version: ${version}`);\n if (!version) {\n // A couple different issues could have occurred, let's check them after we're past the point of no return\n // since we no longer need to be fast about validation.\n\n // Ensure Xcode.app can be found before we prompt to sudo select it.\n if (getXcodeInstalled()) {\n const selectPath = profile(getXcodeSelectPathAsync)();\n debug(`Xcode select path: ${selectPath}`);\n if (!selectPath) {\n Log.error(\n [\n '',\n chalk.bold('Xcode has not been fully setup for Apple development yet.'),\n 'Download at: https://developer.apple.com/xcode/',\n 'or in the App Store.',\n '',\n 'After downloading Xcode, run the following two commands in your terminal:',\n chalk.cyan(' sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'),\n chalk.cyan(' sudo xcodebuild -runFirstLaunch'),\n '',\n 'Then you can re-run Expo CLI. Alternatively, you can build apps in the cloud with EAS CLI, or preview using the Expo Go app on a physical device.',\n '',\n ].join('\\n')\n );\n throw new AbortCommandError();\n } else {\n debug(`Unexpected Xcode setup (version: ${version}, select: ${selectPath})`);\n }\n }\n\n // Almost certainly Xcode isn't installed.\n await promptToOpenAppStoreAsync(\n `Xcode must be fully installed before you can continue. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n\n if (semver.lt(version, SUGGESTED_XCODE_VERSION)) {\n // Xcode version is too old.\n await promptToOpenAppStoreAsync(\n `Xcode (${version}) needs to be updated to at least version ${MIN_XCODE_VERSION}. Continue to the App Store?`\n );\n throw new AbortCommandError();\n }\n }\n}\n"],"names":["Log","debug","require","MIN_XCODE_VERSION","APP_STORE_ID","SUGGESTED_XCODE_VERSION","promptToOpenAppStoreAsync","message","confirm","confirmAsync","initial","log","openAppStore","getXcodeVersionAsync","execSync","last","stdio","toString","match","version","semver","valid","error","appId","link","getAppStoreLink","process","platform","spawnForString","cmd","trim","getXcodeSelectPathAsync","getXcodeInstalled","XcodePrerequisite","Prerequisite","instance","assertImplementation","profile","selectPath","chalk","bold","cyan","join","AbortCommandError","lt"],"mappings":"AAAA;;;;;AAAkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACA,IAAA,aAAe,WAAf,eAAe,CAAA;AACrB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AAEfA,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACmB,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACjC,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACnB,IAAA,QAAwB,WAAxB,wBAAwB,CAAA;AACxB,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,AAAsB,AAAC;AAEhF,4DAA4D;AAC5D,uEAAuE;AACvE,MAAMC,iBAAiB,GAAG,MAAM,AAAC;AACjC,MAAMC,YAAY,GAAG,WAAW,AAAC;AAEjC,MAAMC,uBAAuB,GAAG,CAAC,EAAEF,iBAAiB,CAAC,EAAE,CAAC,AAAC;AAEzD,MAAMG,yBAAyB,GAAG,OAAOC,OAAe,GAAK;IAC3D,0KAA0K;IAC1K,MAAMC,OAAO,GAAG,MAAMC,CAAAA,GAAAA,QAAY,AAA4B,CAAA,aAA5B,CAAC;QAAEC,OAAO,EAAE,IAAI;QAAEH,OAAO;KAAE,CAAC,AAAC;IAC/D,IAAIC,OAAO,EAAE;QACXR,GA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gBAC1C,IAAI,CAACA,UAAU,EAAE;oBACftC,GAAG,CAACsB,KAAK,CACP;wBACE,EAAE;wBACFiB,MAAK,QAAA,CAACC,IAAI,CAAC,2DAA2D,CAAC;wBACvE,iDAAiD;wBACjD,sBAAsB;wBACtB,EAAE;wBACF,2EAA2E;wBAC3ED,MAAK,QAAA,CAACE,IAAI,CAAC,yEAAyE,CAAC;wBACrFF,MAAK,QAAA,CAACE,IAAI,CAAC,mCAAmC,CAAC;wBAC/C,EAAE;wBACF,mJAAmJ;wBACnJ,EAAE;qBACH,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;oBACF,MAAM,IAAIC,OAAiB,kBAAA,EAAE,CAAC;iBAC/B,MAAM;oBACL1C,KAAK,CAAC,CAAC,iCAAiC,EAAEkB,OAAO,CAAC,UAAU,EAAEmB,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC9E;aACF;YAED,0CAA0C;YAC1C,MAAMhC,yBAAyB,CAC7B,CAAC,iFAAiF,CAAC,CACpF,CAAC;YACF,MAAM,IAAIqC,OAAiB,kBAAA,EAAE,CAAC;SAC/B;QAED,IAAIvB,OAAM,QAAA,CAACwB,EAAE,CAACzB,OAAO,EAAEd,uBAAuB,CAAC,EAAE;YAC/C,4BAA4B;YAC5B,MAAMC,yBAAyB,CAC7B,CAAC,OAAO,EAAEa,OAAO,CAAC,0CAA0C,EAAEhB,iBAAiB,CAAC,4BAA4B,CAAC,CAC9G,CAAC;YACF,MAAM,IAAIwC,OAAiB,kBAAA,EAAE,CAAC;SAC/B;KACF;CACF;QAtDYV,iBAAiB,GAAjBA,iBAAiB"}
@@ -7,13 +7,13 @@ exports.createInstallCommand = createInstallCommand;
7
7
  var _config = require("@expo/config");
8
8
  var _chalk = _interopRequireDefault(require("chalk"));
9
9
  var _wrapAnsi = _interopRequireDefault(require("wrap-ansi"));
10
+ var _getMissingPackages = require("./getMissingPackages");
10
11
  var _installAsync = require("../../../install/installAsync");
11
12
  var Log = _interopRequireWildcard(require("../../../log"));
12
13
  var _errors = require("../../../utils/errors");
13
14
  var _interactive = require("../../../utils/interactive");
14
15
  var _ora = require("../../../utils/ora");
15
16
  var _prompts = require("../../../utils/prompts");
16
- var _getMissingPackages = require("./getMissingPackages");
17
17
  function _interopRequireDefault(obj) {
18
18
  return obj && obj.__esModule ? obj : {
19
19
  default: obj