|
|
## Deploy to Testflight (iOS)
|
|
|
|
|
|
NOTE: When typing your project name during setup, make sure they match throughout the setup process.
|
|
|
|
|
|
---
|
|
|
|
|
|
Let’s get started by creating a bundle ID for your app. You will need this later when you create your app in the dashboard.
|
|
|
|
|
|
Navigate to the [Apple Developer Site](https://developer.apple.com/account/resources/identifiers/list)
|
|
|
In the Left-hand nav select Identifiers.
|
|
|
Select the + icon next to Identifiers to add a new bundle ID.
|
|
|
|
|
|
![bundleid](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS1.png)
|
|
|
|
|
|
From the list of Available **IDs** select **App IDs** and **Continue.**
|
|
|
|
|
|
![AppIDs](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS3.png)
|
|
|
Select **App** on the following page and **continue.**
|
|
|
|
|
|
![App](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS2.png)
|
|
|
|
|
|
|
|
|
|
|
|
Enter a **Description** for your App ID and a unique **Bundle ID**. It is recommended to use the reverse of your domain name. *(i.e. com.domainname.appName)*
|
|
|
|
|
|
Under **Bundle ID**, **Explicit** is selected for AppStore and TestFlight apps.
|
|
|
|
|
|
Capabilities checkboxes can be left unchecked for this project.
|
|
|
|
|
|
Select Continue.
|
|
|
|
|
|
![App](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS4.png)
|
|
|
|
|
|
Confirm your information is correct and click **Register** on the final screen.
|
|
|
|
|
|
When you return to the list of identifiers, your new app should appear in the list.
|
|
|
|
|
|
Let’s create your app in the dashboard.
|
|
|
|
|
|
Go to Apps from the top of the AppStoreConnect Screen or navigate to the [Apple App Dashboard]( https://appstoreconnect.apple.com/apps).
|
|
|
|
|
|
Click on the + logo and select **New App** from the dropdown.
|
|
|
|
|
|
![NewApp](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS5.png)
|
|
|
|
|
|
In the **New App** popup, enter your app details.
|
|
|
|
|
|
![NewAppPop](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS6.png)
|
|
|
|
|
|
1. For **Platforms**, select **iOS**.
|
|
|
|
|
|
2. The Name of your App should be unique to App Store Connect.
|
|
|
|
|
|
3. The **Bundle ID** you created earlier should now appear in the dropdown
|
|
|
|
|
|
4. The **SKU** should be another unique name for your app. (*i.e. companyName.project.Name* – this will not be visible)
|
|
|
|
|
|
5. **User Access** can be set to **Limited Access**.
|
|
|
|
|
|
6. Click **Create**. Your app is now created in App Store Connect.
|
|
|
|
|
|
---
|
|
|
|
|
|
**Several Variables will be required for the project and will need to be entered into your project settings in WVS. Below is a table with all the required variables. Further down, you will find an explanation of how to find these variables and where you will need them.**
|
|
|
|
|
|
| Variables | Mask |
|
|
|
| ------------------------ | :-----: |
|
|
|
| WVSUSR_UNITY_USER | |
|
|
|
| WVSUSR_UNITY_PASS |☑️ |
|
|
|
| WVSUSR_APPLE_CODE_SIGNING_GIT_URL | |
|
|
|
| WVSUSR_APPLE_CODE_SIGNING_GIT_PRIVATE_KEY | |
|
|
|
| WVSUSR_APPLE_CODE_SIGNING_GIT_ENCRYPTION_PASSWORD |☑️ |
|
|
|
| WVS_APPLE_APP_NAME | |
|
|
|
| WVSUSR_APPLE_APPLICATION_SPECIFIC_PASSWORD |☑️ |
|
|
|
| WVSUSR_APPLE_CONNECT_API_KEY |☑️ |
|
|
|
| WVSUSR_APPLE_CONNECT_API_KEY_ID |☑️ |
|
|
|
| WVSUSR_APPLE_CONNECT_API_KEY_ISSUER |☑️ |
|
|
|
| WVSUSR_APPLE_DEVELOPER_PORTAL_TEAM_ID | |
|
|
|
| WVSUSR_APPLE_STORE_CONNECT_TEAM_ID | |
|
|
|
|
|
|
|
|
|
|
|
|
For the variable, *WVSUSR_APPLE_CODE_SIGNING_GIT_PRIVATE_KEY*, on a PC, open up Git Bash or if you are on a Mac, open up Terminal and run the following command:
|
|
|
|
|
|
|
|
|
`ssh-keygen -q -t rsa -N '' -f temp_rsa <<<y >/dev/null 2>&1`
|
|
|
|
|
|
|
|
|
|
|
|
This will generate two files known as a public-private key pair, locate the private temp_rsa file and the corresponding public key file temp_rsa.pub and store them in a safe place for now.
|
|
|
|
|
|
Go to [https://wvs.io/projects/new](https://wvs.io/projects/new) and create a new private empty repository to store your keys and name it something unique.
|
|
|
|
|
|
After the project/repository is created, go to your project home page and locate the **Clone** button on the right-hand side. In the **Clone with SSH** section, copy the address and save the following information with the variable for later.
|
|
|
|
|
|
Example Value:
|
|
|
git@wvs.io:wvs/<group_name>/<repository_name>.git
|
|
|
|
|
|
In the same project that you created for your keys in WVS, scroll down to **Project Settings>>Version Control>>Deploy Keys.**
|
|
|
|
|
|
Must have maintainer access to the project to make these changes
|
|
|
|
|
|
Enter a title for your key
|
|
|
|
|
|
Example Title: test_project_key
|
|
|
|
|
|
Open up **temp_rsa.pub** and copy the content of the file and paste it into **Key**
|
|
|
|
|
|
Select the checkbox
|
|
|
**Grant Write permissions to this key**
|
|
|
**Allow this key to push to this repository**
|
|
|
Now add your key.
|
|
|
|
|
|
![AllowAccess](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS7.png)
|
|
|
|
|
|
|
|
|
Navigate to your iOS repo that contains your project and go to **Project Settings>>CI/CD.
|
|
|
Locate **Variables** on the page and expand the section. You will be entering all of the variables in this section.
|
|
|
|
|
|
Enter your first Variable from this section.
|
|
|
|
|
|
*WVSUSR_APPLE_CODE_SIGNING_GIT_URL* = the URL of the empty project you created that stores your keys.
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
The next variable you will need is **WVSUSR_APPLE_CODE_SIGNING_GIT_PRIVATE_KEY**.
|
|
|
|
|
|
Open up your temp_rsa file, copy the file's content, paste it into the value section of the variables, and save.
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
For the variable, **WVSUSR_APPLE_CODE_SIGNING_GIT_ENCRYPTION_PASSWORD**, you can use any secure password of your choice and save. Also, check “on” to set masked variable.
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
The next variable you will be using is **WVS_APPLE_APP_NAME**.
|
|
|
|
|
|
Navigate to [App Store Connect](https://appstoreconnect.apple.com/apps) and check the exact name of your app that was created earlier in the instructions.
|
|
|
|
|
|
Copy and paste the exact name of your app into the value section and save.
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
For the variable **WVS_APPLE_BUNDLE_IDENTIFIER**, you can go back to your app in [App Store Connect](https://appstoreconnect.apple.com/apps) and grab the values for this variable.
|
|
|
|
|
|
Select your app from the dashboard.
|
|
|
On the left-hand side, locate **App Information**
|
|
|
|
|
|
![AllowAccess](https://wvs.io/sopisey/sr-ios-hello-world-unity/-/raw/main/rdmeimg/NLS8.png)
|
|
|
The bundle ID should look something like this: com.companyName.appName
|
|
|
|
|
|
Enter the information to the value for this variable.
|
|
|
|
|
|
Assign the bundleID to **WVS_APPLE_BUNDLE_IDENTIFIER**
|
|
|
|
|
|
Note: The bundleID was the first step in this document
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
Sign in to [Apple](https://appleid.apple.com/) with the same account you use for your developer account. Under Sign-In and Security, select App-Specific Passwords.
|
|
|
|
|
|
|
|
|
![AppleLogin](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS9.png)
|
|
|
|
|
|
In the popup, select the + on the right.
|
|
|
Enter a unique name associated with your app.
|
|
|
Enter the password associated with your Apple ID, and generate a new app-specific password.
|
|
|
|
|
|
Copy the password and add it to the value for the variable
|
|
|
**WVSUSR_APPLE_APPLICATION_SPECIFIC_PASSWORD** in your project settings (masked on)
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
Let's return to our [AppStore Connect Account](https://appstoreconnect.apple.com)
|
|
|
Note: You must have admin access
|
|
|
|
|
|
Select **Users and Access**, and then select the **Keys** tab.
|
|
|
|
|
|
|
|
|
![AppleLogin](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS10.png)
|
|
|
|
|
|
Click the Add (+) button.
|
|
|
Enter a name for the key. The name is for your reference only and is not part of the key itself.
|
|
|
|
|
|
Under **Access**, select the role for the key.
|
|
|
Click **Generate**.
|
|
|
|
|
|
You will see the key populate in the list with the option to download.
|
|
|
Download the key and save it somewhere safe. **(You can only download it once)**
|
|
|
|
|
|
Open the file and copy its content and paste it into the value for the variable, **WVSUSR_APPLE_CONNECT_API_KEY.**
|
|
|
|
|
|
Go back to the **Keys** page in [AppStore Connect](https://appstoreconnect.apple.com) and copy the **KeyID** into the value for **WVSUSR_APPLE_CONNECT_API_KEY_ID** (masked on).
|
|
|
|
|
|
Copy the **Issuer ID** from the **Keys** Page and paste it into the value for **WVSUSR_APPLE_CONNECT_API_KEY_ISSUER** (masked on).
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
For the Variable **WVSUSR_APPLE_DEVELOPER_PORTAL_TEAM_ID**, let’s navigate to our [Apple Developer Account](https://developer.apple.com/) and log in.
|
|
|
|
|
|
Locate the **Team ID** under the Membership section.
|
|
|
![AppleLogin](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS11.png)
|
|
|
|
|
|
---
|
|
|
|
|
|
For the variable **WVSUSR_APPLE_STORE_CONNECT_TEAM_ID**, you’re going to navigate back to [AppStore Connect](https://appstoreconnect.apple.com) and confirm you are logged in.
|
|
|
|
|
|
Once you confirm you are logged in, let’s navigate [here](https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail) to grab some values.
|
|
|
(note: you will see a page with a big block of characters.)
|
|
|
|
|
|
In the **associatedAccounts** array ( between the [ and ] ) you will find all of your teams listed.
|
|
|
|
|
|
Look for the **contentProviderId** that is associated with the team name you want.
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
The Last two Variables you will need are **WVSUSR_UNITY_USER** and **WVSUSR_UNITY_PASS**, which are the credentials for your Unity account.
|
|
|
|
|
|
In your project settings, let’s add
|
|
|
**WVSUSR_UNITY_USER** = Unity Login Email
|
|
|
**WVSUSR_UNITY_PASS** = Unity Login Password
|
|
|
|
|
|
---
|
|
|
|
|
|
Now that your Variables are all set up let's make sure your flows are set up correctly.
|
|
|
|
|
|
Clone your repository if it’s not already on your local machine and open it up in Unity.
|
|
|
|
|
|
Go to **Edit>>ProjectSettings >>Player>>** Select the **iOS** tab and edit your **bundleID** to match the one you created earlier.
|
|
|
|
|
|
![AppleLogin](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS12.png)
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
Open up the **WVS Desktop Client**, and switch to your iOS project.
|
|
|
Start a new changelist and title it anything unique for your task, i.e. “Changing flow settings”
|
|
|
Select the folder icon on the top of the desktop app to navigate to your project locally.
|
|
|
Go to *.wvs/flows/DeployToTestFlight* and open it in your favorite editor.
|
|
|
Under **Inputs**, locate **WVS_SOURCE_IPA** and change it to the exact app name that was set in your App Store Connect:
|
|
|
|
|
|
```
|
|
|
"inputs" : [
|
|
|
{
|
|
|
"name" : "WVS_SOURCE_IPA",
|
|
|
"value" : "$CI_PROJECT_DIR/Builds/iOS/hello-world-unity/<YourAppName>.ipa",
|
|
|
"source" : "BuildUnityIOS"
|
|
|
},
|
|
|
```
|
|
|
Save your changes.
|
|
|
Go to *.wvs/flows/BuildUnityIOS*, under Inputs, locate **WVS_BUILD_NAME** and make sure the value matches the value in your **DeployToTestFlight** flow above.
|
|
|
Save your changes and return to the **WVS Desktop client** and click on **Commit Changelist.**
|
|
|
|
|
|
---
|
|
|
|
|
|
Go back to your project in the **WVS Web-App** and select **Outputs** from the left-hand nav.
|
|
|
You should see your project building and, soon, deploying to your AppStore.
|
|
|
|
|
|
Go to your [AppStore Connect Account](https://appstoreconnect.apple.com) and select your App.
|
|
|
Select the **TestFlight** tab on the top.
|
|
|
Your build should be displayed in the list, and you should now be able to add users to your project.
|
|
|
|
|
|
---
|
|
|
|
|
|
Open **YOUR_REPO/.wvs/flows/BuildUnityIOS.json** and edit **WVS_BUILD_NAME** to match the Product Name in **Unity >> Player Settings**
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"name" : "WVS_BUILD_NAME",
|
|
|
"value" : "MyCoolProject"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
Open **YOUR_REPO/.wvs/flows/DeployToTestflight.json** and edit **WVS_SOURCE_IPA** to match the Product Name in **Unity >> Player Settings**
|
|
|
|
|
|
```
|
|
|
{
|
|
|
"name" : "WVS_SOURCE_IPA",
|
|
|
"value" : "$CI_PROJECT_DIR/Builds/iOS/lightship-templates/MyCoolProject.ipa",
|
|
|
"source" : "BuildUnityIOS"
|
|
|
}
|
|
|
```
|
|
|
Commit and push your changes which should kick off a new flow (build automation)
|
|
|
Go back to your project in the WVS web app and click the flows to see your new flow building.
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
## Common Pittfalls and FAQ
|
|
|
|
|
|
**Question** *What is **TestFlight**?*
|
|
|
**Answer** *Testflight is a service that is provided by Apple for installation and testing of mobile applications. More Information can be found on [Apple's developer site](https://developer.apple.com/testflight/).*
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I don’t see a flow after setting everything up and making a commit with all my changes.*
|
|
|
**Solution** *Open your **WVS Web-App** and go to ** Project Settings >> CI/CD ** General Pipelines.*
|
|
|
*In the CI/CD configuration file, make sure the path is *.wvs/root-ci.yml* and click the **Save Changes** button. Then make another commit to see if the flow is now working. You can always make a small change to the readme file and commit it.*
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I don’t see an iOS tab in my Player Settings in Unity.*
|
|
|
**Solution** *In **Unity Hub**, select **Installs** from the left-hand side and locate the Unity Version you use for your project. Make sure it has an iOS package labeled on the version you are using. If it does not, select the gear icon on the right and select add modules. Locate **iOS Build Support** in the list and select install. Once that installs, restart unity and continue with the instructions above.*
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *My project did not build to TestFlight on my AppStore connect.*
|
|
|
**Solution** *Go to your project in WVS, select Flows from the left-hand nav, and click on the Pass/Fail icon in your build browser. If jobs fail, confirm your flows are set up correctly.*
|
|
|
|
|
|
A few things to consider, re-checking naming conventions is important when setting up your flows. Be sure the name matches during setup.
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
Current license is invalid and cannot be activated.
|
|
|
You must delete the license file and then activate a new license on the current machine.
|
|
|
Run succeeded, no failures occurred
|
|
|
|
|
|
**Solution** *Confirm the following Variables are added correctly:*
|
|
|
|
|
|
WVSUSR_UNITY_USER
|
|
|
WVSUSR_UNITY_PASS
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
Authentication credentials are missing or invalid. -
|
|
|
Provide a properly configured and signed bearer token,
|
|
|
and make sure that it has not expired.
|
|
|
|
|
|
**Solution** *If your flow failed in the build stage (not the deploy stage), then it is most likely related to the code signing of the app. Open [Apple's Developer site](https://developer.apple.com/testflight/) and check **User Access >> Keys** . Make sure you have the right variables for* :
|
|
|
|
|
|
WVSUSR_APPLE_CONNECT_API_KEY
|
|
|
WVSUSR_APPLE_CONNECT_API_KEY_ID
|
|
|
WVSUSR_APPLE_CONNECT_API_KEY_ISSUER
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
{:PLATFORM_NAME=>nil, :LANE_NAME=>"beta", :KEYCHAIN_PATH=>"~/Library/Keychains/wvsMatchKeychainName.keychain"}
|
|
|
1193ERROR [2022-09-29 22:09:02.11]: No password supplied
|
|
|
|
|
|
**Solution** *Make sure you have a variable called *WVSUSR_APPLE_CODE_SIGNING_GIT_ENCRYPTION_PASSWORD* and it is set up correctly. Add any password of your choice (lowercase, uppercase, and numbers)*
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
$ cp $WVS_SOURCE_IPA app.ipa
|
|
|
YOUR_PATH.ipa: No such file or directory
|
|
|
|
|
|
**Solution:** *Open **/.wvs/flows/DeployToTestflight.json** and make an edit to*
|
|
|
|
|
|
WVS_SOURCE_IPA
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
"value" : "$CI_PROJECT_DIR/Builds/iOS/$CI_PROJECT_DIR/YOUR_PRODUCT_NAME.ipa",
|
|
|
YOUR_PRODUCT_NAME needs to match the “product name” from the Unity Player setting
|
|
|
|
|
|
**Solution:** *Navigate back to your project settings in unity and double check your Product Name matches the names you’ve used for your app throughout the setup process.*
|
|
|
|
|
|
![Player](https://wvs.io/wvs-project-examples/hello-world-unity-mobile/-/raw/main/rdmeimg/NLS13.png)
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I am seeing an error that says **No such file or directory**, but I do not understand why.*
|
|
|
|
|
|
**Solution:** *There are a few things to check in your project. First, make sure that your naming convention is correct. Keep your project name consistent throughout. For example, if you named your project **MyTestProject**, you’ll want to keep it that way throughout the setup process. If you enter **myTestproject** in another location, this could potentially cause your build to fail.*
|
|
|
|
|
|
Another place to check is your failed flow. Does the name of your project/app match others in the project?
|
|
|
|
|
|
*Lastly, confirm you have the correct path to your project in your **DeployToTestFligh**t flow, under **WVS_SOURCE_IPA**.*
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
**Problem:** *I see the following error in my deployment job:*
|
|
|
|
|
|
There are no local code signing identities found.
|
|
|
|
|
|
|
|
|
**Solution:** *This is often not the error that failed your build. This is by design, as the code signing identities are not installed on the machine at the time. They are downloaded on demand during the build process from the encrypted git repository you set up earlier.* |