For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/native-apps/eject.md.

Eject the native projects

Ejecting writes the generated Xcode and Android Studio projects into your project, so you can change anything in them. It's a last resort:

  • For Swift or Kotlin of your own, a native module or a native element, add a native plugin instead. The builder keeps generating the projects.
  • Eject for a native change neither covers, such as adding a native library.
ng generate @blotch/angular-lynx:eject                    # both platforms
ng generate @blotch/angular-lynx:eject --platform ios     # or android

This writes the generated projects into ios/ and android/ at your project root. From then on you edit them in Xcode or Android Studio, and commit them. ng build --platform builds those folders as they are, with your latest bundle and signing.

What it costs

Ejecting is one-way, and it costs you:

  • The identity options stop applying. Name, ID, version, icon, permissions and the rest now live in the native projects. The signing options still apply.
  • Device features stay as they were. A project keeps the features that were on when you ejected it, with their permissions, until you take them out of the native projects. A project ejected without the bluetooth permission has no Bluetooth module, so adding Bluetooth later is a native change, with the module's reasons in ios/App/PrivacyInfo.xcprivacy, the app's privacy manifest. See Ejected apps.
  • Upkeep becomes your job. New Lynx versions, new Xcode versions and Google Play's yearly requirements no longer arrive with AngularLynx updates.
  • The native modules AngularLynx calls can change with an update. An ejected project keeps the ones it was ejected with. When the release notes say a module changed, copy the new one from @blotch/angular-lynx-native's templates folder into the native project, with any changes you made to it. For example, LynxMotion's watches get nothing from an older MotionModule, which has start and stop rather than addWatch and removeWatch.
  • You need native knowledge to change the projects.

Things to know

  • Android's release build runs R8, which removes and renames Java and Kotlin it can't see used. Code you add that's only reached by name, through reflection or from native code, needs keep rules in android/app/proguard-rules.pro. A native module that extends LynxModule is kept already.
  • A project ejected before the build wrote the privacy manifest has none. Add ios/App/PrivacyInfo.xcprivacy yourself, or App Store Connect can refuse the upload (ITMS-91053). To get one, move ios/ aside, eject iOS alone again (ng generate @blotch/angular-lynx:eject --platform ios, which leaves android/ as it is), and copy the new ios/App/PrivacyInfo.xcprivacy into yours. Then put your ios/ back. The copy has the reasons for the modules your current angular.json keeps, which may not be the ones your ios/App/ has. Make it match: add the reasons of each module your ios/App/ has that the copy lacks, and take a reason out only when no module you keep needs it (35F9.1, for example, is Bluetooth's, the audio recorder's and motion's):
    • LocalStorageModule.swift and DevServer.swift: NSPrivacyAccessedAPICategoryUserDefaults, CA92.1
    • BluetoothModule.swift and AudioRecorderModule.swift: NSPrivacyAccessedAPICategorySystemBootTime, 35F9.1
    • MotionModule.swift: NSPrivacyAccessedAPICategorySystemBootTime, 35F9.1 and 8FFB.1
  • ng serve --platform builds the ejected project too. On a real iPhone, add NSLocalNetworkUsageDescription to its Info.plist, so iOS can say why the app reaches your Mac. See On a real iPhone.

Go back

To go back to the generated project, delete the folder.