-
Notifications
You must be signed in to change notification settings - Fork 0
Core Concepts in React Native
brewblue edited this page May 30, 2025
·
1 revision
- Compilation: Your JavaScript/TypeScript code gets compiled into native iOS code
-
Build Generation: Creates a
build/folder containing:- Compiled app files ready for installation
- Precompiled modules (for faster future builds)
- Build logs and debugging info
- Xcode index files for code navigation
- App Launch: Installs and runs the app on simulator or device
ios/
βββ YourAppName/ # Main app folder
β βββ *.entitlements # App permissions/capabilities
β βββ Info.plist # App configuration
βββ Pods/ # CocoaPods dependencies
βββ build/ # Generated after compilation (safe to delete)
- What they are: XML files that tell iOS what your app is allowed to do
-
Where they live:
ios/YourApp/YourApp.entitlements -
What they control:
- Camera/photo access
- iCloud storage
- Push notifications
- Background processing
- Keychain access
- And much more...
1. Add entitlement to .entitlements file
2. Enable capability in Apple Developer Console
3. Update provisioning profile
4. Rebuild & reinstall app
- Simulator: More permissive, often ignores missing entitlements
- Physical Device: Strictly enforces all entitlements and permissions
- Result: Apps that work in simulator may crash on real devices without proper entitlements
β What DOESN'T work:
- Just editing the
.entitlementsfile - Hot reloading
- Metro bundler refresh
β What you MUST do:
-
Local: Update
.entitlementsfile - Remote: Enable capability in Apple Developer Console
- Rebuild: Clean build and compile again
- Reinstall: Deploy new version to device
- Changing the file locally = filling out the form
- Apple Developer Console = DMV approval
- Rebuilding = printing the new license
- Reinstalling = actually carrying the new license
# Clean everything
cd ios && rm -rf build/ && cd ..
# Refresh dependencies
cd ios && pod install && cd ..
# Deploy to device
yarn ios --device "Your iPhone Name"- Open
ios/YourApp.xcworkspacein Xcode - Select your physical device as target
- Build and run (β+R)
- You're making a contract with Apple about what your app can do
- Both your code AND Apple's servers must agree on this contract
- Breaking the contract = app won't run on real devices
- Gets messy during cooking (compilation)
- Safe to clean and start fresh
- Will be recreated every time you cook (build)
- Simulator is like a rehearsal
- Real device is the actual performance
- What works in rehearsal might fail in the real show without proper preparation
- "Works in simulator, crashes on device" = Missing entitlements
- "Changed entitlements, nothing happened" = Forgot to rebuild/reinstall
- "Build fails with entitlement errors" = Apple Developer Console not updated
- "App installs but feature doesn't work" = Entitlement exists but provisioning profile is old
Remember: iOS development requires this three-way handshake between your code, Apple's servers, and the device. Skip any step, and things break!