cli
cli copied to clipboard
feat: add --binary-path to run-ios and run-android to enable installing pre-build binaries
Summary:
Add support for --binary-path option to run-ios and run-android. This allows a caller to specify their own (pre-built) binary that they want to install on devices, while still keeping all the great os/emulator/device support that react-native-community-cli brings.
Test Plan:
- [x]
react-native run-iosworks & builds from scratch - [x]
react-native run-ios --deviceworks & builds from scratch - [x]
react-native run-ios --binary-path [PATH]works & installs pre-built.appon simulator - [x]
react-native run-ios --device --binary-path [PATH]works & installs pre-built.appon device - [x]
react-native run-androidworks & builds from scratch - [x]
react-native run-android --deviceId [ID]works & builds from scratch - [x]
react-native run-android --binary-path [PATH]works & installs pre-built.apkon emulator/device - [x]
react-native run-android --deviceId [ID] --binary-path [PATH]works & installs pre-built.apkon emulator/device - [x]
react-native run-android --binary-path [PATH] --tasks 'test'throws;tasksandbinary-pathare not compatible - [ ] catalyst build works as expected
- [ ] catalyst build throws if
--binary-pathspecified
Hey, this is interesting. What's the main use case, speed up the local builds, or maybe something else? Feel free to share your desired workflow :)
Hey, this is interesting. What's the main use case, speed up the local builds, or maybe something else? Feel free to share your desired workflow :)
Hey! The use-case as I see them are:
- speed-up local build. First build can be relatively slow still, incremental builds are fine. Building once and never re-building again until native code changes (even if you want to install on a new device) would be great
- speed-up build of other devs. We can share the pre-built .apk/.app within the dev team
- remove the need for most developers to setup & maintain native development tooling and deal with possible build issues. Only devs adding native code/libs need to have the tooling setup. The rest just need:
- the JS toolchain
- adb
- xcode/command-line-tools
- respective device and (optional) simulator/emulator
@thymikee do you have any thoughts on the feature?
I think it makes sense. Is it ready for a review?
I think it makes sense. Is it ready for a review?
It is ready for review. I just rebased it on latest main for your convenience
There hasn't been any activity on this pull request in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
@thymikee did you get a chance to review yet? Happy to rebase if needed
cc @adamTrz @TMisiukiewicz
Looks like the rebase is needed indeed, so if that's not a problem, I'd appreciate it 👍🏼
Looks like the rebase is needed indeed, so if that's not a problem, I'd appreciate it 👍🏼
@thymikee done
@andrejborstnik if possible, please add command description to docs/commands.md :)
@andrejborstnik if possible, please add command description to
docs/commands.md:)
Done, lmk if the description sounds good or needs tweaking
LGTM 👍
Ugh, sorry for pinging you once more @andrejborstnik but there yet another merge conflicts present. Would you mind resolving them and then we can at least merge you PR? 🙂
Ugh, sorry for pinging you once more @andrejborstnik but there yet another merge conflicts present. Would you mind resolving them and then we can at least merge you PR? 🙂
@adamTrz rebased. Double-checked the rebase is ok, but might be worth re-running CI just in case
@andrejborstnik LGTM! All checks are green, merging 🎉 Thanks for the contribution 🙂