Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: nixify react native setup #3108

Merged
merged 7 commits into from
Mar 10, 2024
Merged

chore: nixify react native setup #3108

merged 7 commits into from
Mar 10, 2024

Conversation

sandipndev
Copy link
Member

@sandipndev sandipndev commented Mar 8, 2024

This PR installs all required Android SDKs, Ruby, Cocoapods, Fastlane and all required build tools in a deterministic manner using Nix Flakes. Unfortunately, Xcode can't be automatically installed because Apple License lets only Apple serve Xcode binaries (needs authentication into your Apple Account) but the setup of installing the right version of Xcode has been added in this PR.

This PR also brings in the necessary documentation to do any dev work in a simpler and faster manner for this repo.


How to check if the setup works on your machine:

  1. Checkout this PR
  2. Enable direnv hook and run direnv allow (~1.5GB download for Android SDK)
  3. Run yarn install
  4. Run yarn start in one terminal.
  5. Android: Run make emulator on one terminal and yarn android in another. If you get "error Failed to launch emulator." in the yarn android run, it's cool. This won't exit the android build, our emulator device will be available to Android Debug Bridge(adb). If yarn start failed on the first run, don't worry as it's a known issue, you can restart the yarn start command and everything rerun the yarn android command.
  6. (if you're on Mac) iOS: Install updated Xcode. You can do it using the xcodes CLI as well as you should be shown in the direnv logs (~9-10 GB download for downloading and selecting Xcode) If you don't have iOS Runtime, then you should also do xcodes runtimes install "iOS 17.4". With that, now you can run yarn ios for Blink to run.

Ruby gets built on your machine so the first run can take about 5-6 minutes to install everything.


Working on Linux

Tested on:

  • @vindard's system (yet to verify)
  • a fresh install of Ubuntu with + without Android Studio
  • a fresh install Manjaro KDE
  • existing Archcraft that I used for a long time

image

Working on MacOS

Tested on:

  • Macbook Air M2 2023
  • x86-64 Intel based Macbook Pro 2017
Android Development
Screenshot 2024-03-10 at 6 20 49 PM
iOS Development
Screenshot 2024-03-10 at 6 30 07 PM

@nicolasburtey nicolasburtey merged commit d4350e2 into main Mar 10, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants