
Many companies use
Continuous Integration .
For example, in Git there can be three branches: customer, master, test.
Push to customer or test initiates the creation of the assembly, as well as its delivery to the customer’s devices or testers.
For distribution of test builds on iOS,
Ad Hoc profiles are used . The bottom line is that the assembly must be signed by a profile that indicates the UUID of the devices on which it can be installed.
The procedure for adding / removing a device to an ad hoc profile requires its re-creation. After the profile is updated, it should be installed on the assembly node (the computer on which the assembly is being assembled). Usually the profile update procedure is performed via Xcode, which requires access to the build node via VNC and direct human participation.
')
Fortunately, everything can be automated, including the process of updating profiles at the start of an assembly.
As far as I know, there are two ways to automate profile updates using
Jenkins .
Store profile in repository
- We download the necessary profile from Apple Dev Center and put it in Git as "profiles / customer.mobileprovision".
- In the build settings in the field Embedded Profile write the path "profiles / customer.mobileprovision".
- In Xcode for the corresponding configuration in Build Settings, select the profile - None and identity - automatic.
We update a profile before assembly
A very good man named Matt Thompson (I recommend his
Blog ) created a client to work with the Apple Dev Center from the console. The client is called
Cupertino , written in Ruby and put in one line:
gem install cupertino
Now you can not put “profiles / customer.mobileprovision” in Git, but instead write something like this in the bash script:
rm -rf profiles mkdir profiles update_cert "TestCert" profiles/customer.mobileprovision
Similar to the previous method, it is necessary in XCode for the corresponding configuration in Build Settings to select a profile - None and identity - automatic.
The update_cert script looks like this:
You can do without update_cert, but in this case the name of the downloaded certificate will be the same as in the Apple Dev Center.
Obviously, the scripts can be customized to fit your needs. For example, if you can not download a certificate (problem with the network), then use the existing one and so on.
Conclusion
Auto-update profiles is easy and convenient.
Use on health.