|
1 | 1 | --- |
2 | | -title: Packaging |
| 2 | +title: Deployment |
3 | 3 | order: 300 |
4 | 4 | --- |
5 | 5 |
|
| 6 | +Deploying mobile apps is a complicated process — and it's different for each platform! Generally speaking you need to: |
| 7 | + |
| 8 | +1. **Releasing**: Create a _release build_ for each platform. |
| 9 | +2. **Testing**: Test this build on real devices. |
| 10 | +3. **Packaging**: Sign and distribute this build to the stores. |
| 11 | +4. **Submitting for Review**: Go through each store's submission process to have your app reviewed. |
| 12 | +5. **Publishing**: Releasing the new version to the stores and your users. |
| 13 | + |
| 14 | +It's initially more time-consuming when creating a brand new app in the stores, as you need to get the listing set up |
| 15 | +in each store and create your signing credentials. |
| 16 | + |
| 17 | +If you've never done it before, allow a couple of hours so you can focus on getting things right and understand |
| 18 | +everything you need. |
| 19 | + |
| 20 | +Don't rush through the app store processes! There are compliance items that if handled incorrectly will either prevent |
| 21 | +you from publishing your app, being unable to release it in the territories you want to make it available to, or simply |
| 22 | +having it get rejected immediately when you submit it for review if you don't get those right. |
| 23 | + |
| 24 | +It's typically easier once you've released the first version of your app and after you've done 2 or 3 apps, you'll fly |
| 25 | +through the process! |
| 26 | + |
| 27 | +<aside> |
| 28 | + |
| 29 | +#### Need help? |
| 30 | + |
| 31 | +This page is here to help you _configure and use NativePHP_ to prepare your app for release; it is not a guide around |
| 32 | +the stores. You should consult the [App Store Connect Help](https://developer.apple.com/help/app-store-connect/) and |
| 33 | +[Play Console Help](https://support.google.com/googleplay/android-developer/?hl=en-GB#topic=3450769) documentation for |
| 34 | +detailed and up-to-date guidance on how to prepare your app submissions and listings. |
| 35 | + |
| 36 | +If you want more hands-on support, we happily work with our [Partners](/partners) to support them releasing their apps. |
| 37 | + |
| 38 | +</aside> |
| 39 | + |
| 40 | +## Releasing |
| 41 | + |
| 42 | +To prepare your app for release, you should set the version number to a new version number that you have not used |
| 43 | +before and increment the build number: |
| 44 | + |
| 45 | +```dotenv |
| 46 | +NATIVEPHP_APP_VERSION=1.2.3 |
| 47 | +NATIVEPHP_APP_VERSION_CODE=48 |
| 48 | +``` |
| 49 | + |
| 50 | +### Versioning |
| 51 | + |
| 52 | +You have complete freedom in how you version your applications. You may use semantic versioning, codenames, |
| 53 | +date-based versions, or any scheme that works for your project, team or business. |
| 54 | + |
| 55 | +Remember that your app versions are usually public-facing (e.g. in store listings and on-device settings and update |
| 56 | +screens) and can be useful for customers to reference if they need to contact you for help and support. |
| 57 | + |
| 58 | +The build number is managed via the `NATIVEPHP_APP_VERSION` key in your `.env`. |
| 59 | + |
| 60 | +### Build numbers |
| 61 | + |
| 62 | +Both the Google Play Store and Apple App Store require your app's build number to increase for each release you submit. |
| 63 | + |
| 64 | +The build number is managed via the `NATIVEPHP_APP_VERSION_CODE` key in your `.env`. |
| 65 | + |
| 66 | +### Run a `release` build |
| 67 | + |
| 68 | +Then run a release build: |
| 69 | + |
| 70 | +```shell |
| 71 | +php artisan native:run --build=release |
| 72 | +``` |
| 73 | + |
| 74 | +This builds your application with various optimizations that reduce its overall size and improve its performance, such |
| 75 | +as removing debugging code and unnecessary features (i.e. Composer dev dependencies). |
| 76 | + |
| 77 | +**You should test this build on a real device.** Once you're happy that everything is working as intended you can then |
| 78 | +submit it to the stores for approval and distribution. |
| 79 | + |
| 80 | +- [Google Play Store submission guidelines](https://support.google.com/googleplay/android-developer/answer/9859152?hl=en-GB#zippy=%2Cmaximum-size-limit) |
| 81 | +- [Apple App Store submission guidelines](https://developer.apple.com/ios/submit/) |
| 82 | + |
6 | 83 | ## Packaging Your App |
7 | 84 |
|
8 | | -The `native:package` command creates signed, production-ready apps for distribution to the App Store and Play Store. This command handles all the complexity of code signing, building release artifacts, and preparing files for submission. |
| 85 | +The `native:package` command creates signed, production-ready apps for distribution to the App Store and Play Store. |
| 86 | +This command handles all the complexity of code signing, building release artifacts, and preparing files for submission. |
9 | 87 |
|
10 | 88 | <aside> |
11 | 89 |
|
|
0 commit comments