mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6df04ae666
Summary: Changelog: [Internal] * Sets a default custom reporter in `scripts/packager.sh` that redirects Metro's logs to a JSON file when the `RCT_PACKAGER_LOG_PATH` environment variable is set. Otherwise we use Metro's `TerminalReporter`, [like the CLI does by default](https://github.com/react-native-community/cli/blob/0993f627869f4de0e5a8a9a950d38a9f15e18fb2/packages/cli-plugin-metro/src/commands/start/runServer.ts#L124). * Modifies `scripts/launchPackager.command` to write logs to `$RCT_PACKAGER_LOGS_DIR` (and in particular use the JSON reporter) if this environment var is set. * Uses [`open -n`](https://ss64.com/osx/open.html#:~:text=Open%20a%20new%20instance%20of%20the%20application) to execute `launchPackager.command` from Xcode, so that environment variables are reliably passed to the script even if a Terminal process is already running. Reviewed By: yungsters Differential Revision: D32295290 fbshipit-source-id: 4d783e1f94d122d3a35c104b2b02dbfaf8e1a1a3