printRunInstructions.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _path() {
  7. const data = _interopRequireDefault(require("path"));
  8. _path = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _fs() {
  14. const data = _interopRequireDefault(require("fs"));
  15. _fs = function () {
  16. return data;
  17. };
  18. return data;
  19. }
  20. function _chalk() {
  21. const data = _interopRequireDefault(require("chalk"));
  22. _chalk = function () {
  23. return data;
  24. };
  25. return data;
  26. }
  27. function _cliTools() {
  28. const data = require("@react-native-community/cli-tools");
  29. _cliTools = function () {
  30. return data;
  31. };
  32. return data;
  33. }
  34. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  35. /**
  36. * Copyright (c) Facebook, Inc. and its affiliates.
  37. *
  38. * This source code is licensed under the MIT license found in the
  39. * LICENSE file in the root directory of this source tree.
  40. *
  41. * @format
  42. */
  43. function printRunInstructions(projectDir, projectName) {
  44. const iosProjectDir = _path().default.resolve(projectDir, 'ios');
  45. const iosPodsFile = _path().default.resolve(iosProjectDir, `${projectName}.xcworkspace`);
  46. const isUsingPods = _fs().default.existsSync(iosPodsFile);
  47. const relativeXcodeProjectPath = _path().default.relative('..', isUsingPods ? iosPodsFile : _path().default.resolve(iosProjectDir, `${projectName}.xcodeproj`));
  48. _cliTools().logger.log(`
  49. ${_chalk().default.cyan(`Run instructions for ${_chalk().default.bold('iOS')}`)}:
  50. • cd "${projectDir}" && npx react-native run-ios
  51. ${_chalk().default.dim('- or -')}
  52. • Open ${relativeXcodeProjectPath} in Xcode or run "xed -b ios"
  53. • Hit the Run button
  54. ${_chalk().default.green(`Run instructions for ${_chalk().default.bold('Android')}`)}:
  55. • Have an Android emulator running (quickest way to get started), or a device connected.
  56. • cd "${projectDir}" && npx react-native run-android
  57. ${_chalk().default.magenta(`Run instructions for ${_chalk().default.bold('Windows')} and ${_chalk().default.bold('macOS')}`)}:
  58. • See ${_chalk().default.underline('https://aka.ms/ReactNative')} for the latest up-to-date instructions.
  59. `);
  60. }
  61. var _default = printRunInstructions;
  62. exports.default = _default;
  63. //# sourceMappingURL=printRunInstructions.js.map