Skip to content

Commit 6e19f99

Browse files
authored
Merge pull request #17 from thecodingmachine/feature/README
Updating the docs/beta builds.md
2 parents a04d3a3 + dda5520 commit 6e19f99

File tree

1 file changed

+60
-33
lines changed

1 file changed

+60
-33
lines changed

docs/beta builds.md

Lines changed: 60 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Developers love writing React Native code but no one likes deploying React Nativ
44

55
All your headaches will disappear with this documentation and the amazing [Fastlane](https://fastlane.tools/) tool :)
66

7+
78
## Before you start
89

910
You need a Mac. I'm sorry, but if you are a Windows user, you can stop reading right now.
@@ -14,25 +15,27 @@ Let's explain which tools we are using to distribute beta builds:
1415
* [TestFlight](https://developer.apple.com/testflight/), part of App Store Connect, let you build your iOS app and invite internal or external users to test it
1516
* [Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which does the same job as TestFlight for Android apps
1617

18+
1719
## Installing Fastlane
1820

1921
First you need to install Fastlane on your Mac. Follow these steps:
2022

2123
1. Install the latest Xcode command line tools:
2224
```
23-
xcode-select --install
25+
$ xcode-select --install
2426
```
2527
2. Install Ruby using [Homebrew](https://brew.sh/):
2628
```
27-
brew install ruby
29+
$ brew install ruby
2830
```
2931
3. Install Fastlane with RubyGems:
3032
```
31-
sudo gem install fastlane -NV
33+
$ sudo gem install fastlane -NV
3234
```
3335

3436
You are now ready to set up Fastlane for iOS and Android :rocket:
3537

38+
3639
## iOS
3740

3841
### Prerequisites
@@ -44,21 +47,35 @@ Before continuing make sure you have:
4447
- [ ] An Apple ID with an admin user, with its username (email, for example `[email protected]`) and password
4548
- [ ] Your app name, if not already created on the Developer Portal (for example `TCM React Native Boilerplate`). Fastlane can create applications in the Developer Portal and App Store Connect, so it's recommended to let Fastlane do the job for you.
4649
- [ ] Use the right [.gitignore](ios/.gitignore) file inside the `ios` directory
50+
- [ ] You also need to create an App Icon to use Fastlane or you will get an error on running `fastlane beta`. You can simply create one on using the website [AppIconMaker](http://appiconmaker.co/)
4751

4852
Open your Xcode project and modify some information:
4953

50-
- [ ] In the `General` tab, `Identity` section, change the `Bundle Identifier` to your identifier
54+
- [ ] In the `General` tab, `Identity` section, change the `Bundle Identifier` to your identifier (useful for Fastlane)
5155
- [ ] In the `General` tab, `Signing` section, disable `Automatically manage signing`
52-
- [ ] In the `Build Settings` tab, under `Signing`, set `Don't Code Sign` as the `debug` codesigning identity and `iOS Distribution` as the `release` codesigning identity (for both `Debug`/`Release` and `Any iOS SDK`).
56+
- [ ] In the `Build Settings` tab, `Signing` section and into `Code Signing Identity`, set `Don't Code Sign` for the `debug` line (including `Any iOS SDK` also) and set `iOS Distribution` for the `release` line (including `Any iOS SDK` also).
57+
58+
Like this:
59+
60+
| Code Signing Identity | < Multiple values > |
61+
| ------------- | ------------- |
62+
| Debug | Don't Code Sign |
63+
| Any iOS SDK | Don't Code Sign |
64+
| Release | iOS Distribution |
65+
| Any iOS SDK | iOS Distribution |
66+
5367

5468
### Setting up
5569

5670
First you need to set up Fastlane for your iOS project:
5771
```
58-
cd my-project/ios
59-
fastlane init
72+
$ cd my-project/ios
73+
$ fastlane init
6074
```
6175

76+
*Note: If you have an error on this step, please see the `issues` section.*
77+
78+
6279
Fastlane will automatically detect your project and ask for any missing information.
6380

6481
The following questions will be asked:
@@ -73,18 +90,6 @@ The following questions will be asked:
7390
* If you don't know, you didn't read the "Prerequisites" step :)
7491
Our answer is `keep it secret`
7592

76-
At this step, you may have the following issue:
77-
```
78-
fastlane init failed
79-
["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
80-
Something failed while running `fastlane init`
81-
Tried using Apple ID with email '[email protected]'
82-
You can either retry, or fallback to manual setup which will create a basic Fastfile
83-
Would you like to fallback to a manual Fastfile? (y/n)
84-
```
85-
Answer `n`, and retry previous steps with a correct Apple ID and password.
86-
Make sure you are connected to internet.
87-
8893
* If your account has multiple teams in the App Store Connect, you may have this question: `Multiple App Store Connect teams found, please enter the number of the team you want to use:`
8994
* Select the right team
9095
* If your account has multiple teams in the Developer Portal, you may have this question: `Multiple teams found on the Developer Portal, please enter the number of the team you want to use:`
@@ -97,7 +102,8 @@ Make sure you are connected to internet.
97102

98103
Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
99104

100-
Congrats! Fastlane has created some files.
105+
**Congrats!** Fastlane has created some files.
106+
101107
If you are using Git, commit all generated files.
102108

103109
Once the setup has finished you can see a new folder inside the `ios` folder:
@@ -107,6 +113,10 @@ Once the setup has finished you can see a new folder inside the `ios` folder:
107113
- Fastfile
108114
```
109115

116+
It's not finish, you need to follow `Code Signing` part to setting up a provisioning profile.
117+
118+
For information:
119+
110120
`Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
111121
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
112122

@@ -118,6 +128,7 @@ This `lane` contains 3 actions:
118128
* build your app
119129
* upload to TestFlight
120130

131+
121132
### Code signing
122133

123134
Signing your app assures users that it is from a known source and the app hasn’t been modified since it was last signed. Before your app can integrate app services, be installed on a device, or be submitted to the App Store, it must be signed with a certificate issued by Apple.
@@ -127,7 +138,7 @@ A full guide is available on the fastlane doc, describing the best approaches fo
127138
Using `match` is probably [the best solution](https://codesigning.guide/).
128139
Because we don't want to revoke our existing certificates, but still want an automated setup, we will use [cert and sigh](https://docs.fastlane.tools/codesigning/getting-started/#using-cert-and-sigh).
129140

130-
Add the following to your `Fastfile`, just after the `increment_build_number` function and before `build_app`:
141+
Add the following lines to your `Fastfile`, just after the `increment_build_number` function and before `build_app` (Note that you will need to replace some information):
131142
```
132143
get_certificates( # Create or get certificate, and install it
133144
output_path: "./builds" # Download certificate in the build folder (you don't need to create the folder)
@@ -149,7 +160,7 @@ Add the following to your `Fastfile`, just after the `increment_build_number` fu
149160

150161
Then, we need to configure the provisioning profile for the build step.
151162

152-
Add the following to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter:
163+
Add the following lines to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter (Make sure you add a `,` after the `scheme` parameter):
153164
```
154165
clean: true,
155166
export_method: "app-store",
@@ -161,7 +172,6 @@ Add the following to your `Fastfile`, inside the `build_app` function, just afte
161172
build_path: "./builds",
162173
output_directory: "./builds"
163174
```
164-
Make sure you have a `,` after the `scheme` parameter.
165175

166176
Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
167177
:rocket: You are now ready to create your first beta build.
@@ -173,8 +183,8 @@ Creating a beta build and uploading it on TestFlight is now really easy.
173183
Just type the following:
174184

175185
```
176-
cd my-project/ios
177-
fastlane beta
186+
$ cd my-project/ios
187+
$ fastlane beta
178188
```
179189

180190

@@ -197,8 +207,8 @@ Before continuing make sure you have:
197207

198208
First you need to set up Fastlane for your android project:
199209
```
200-
cd my-project/android
201-
fastlane init
210+
$ cd my-project/android
211+
$ fastlane init
202212
```
203213

204214
Fastlane will automatically detect your project and ask for any missing information.
@@ -250,18 +260,35 @@ Creating a beta build and uploading it on Google Play is now really easy.
250260
Just type the following:
251261

252262
```
253-
cd my-project/android
254-
fastlane beta
263+
$ cd my-project/android
264+
$ fastlane beta
255265
```
256266

257267
If you have a `Permission denied` issue, please run:
258268
```
259-
chmod a+x /my-project/android/gradlew
269+
$ chmod a+x /my-project/android/gradlew
260270
```
261271

272+
262273
## Troubleshooting
263274

264-
### Stuck at `bundle install` running `fastlane init`
275+
### Stuck at `bundle install` or `bundle update` running `fastlane init`
276+
277+
If the `fastlane init` process is stuck when running `bundle install` or `bundle update` it may mean that `bundle` command is asking for root permissions.
278+
You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes by running this command:
279+
```
280+
$ sudo chown <your-user> <files>
281+
```
282+
265283

266-
If the `fastlane init` process is stuck when running `bundle install` it may mean that `bundle install` is asking for root permissions.
267-
You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes (`sudo chown <your-user> <files>`).
284+
### Fastlane init failed
285+
```
286+
fastlane init failed
287+
["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
288+
Something failed while running `fastlane init`
289+
Tried using Apple ID with email '[email protected]'
290+
You can either retry, or fallback to manual setup which will create a basic Fastfile
291+
Would you like to fallback to a manual Fastfile? (y/n)
292+
```
293+
Answer `n`, and retry previous steps with a correct Apple ID and password.
294+
Make sure you are connected to internet.

0 commit comments

Comments
 (0)