Build Trio with Xcode
Overview¶
Time Estimate
- 60-80 minutes for first-time builders.
- 10-15 minutes for repeat builders.
Summary
You will:
- Run the 'Build Select Script' to download Trio code.
- Follow the step-by-step instructions in the script.
- Press the Xcode 'Run' button to build Trio.
- Watch in awe as you build your very own app.
FAQs
- Why does Xcode show a colorful spinning icon and not respond to me? Unfortunately, sometimes Xcode gets confused, and you must force-quit the application.
- Many more FAQs for building Trio align with the steps that trigger the questions.
Build Trio with Xcode¶
Browser Builders
If you previously built Trio using the Browser Build method, it is recommended that you disable 'Automatic Install' from TestFlight. This will ensure that the app created with Xcode remains on the phone.
Download Trio with 'Trio Build Select Script'¶
Trio uses the Trio Build Select Script to download Trio's source code, prepare your computer, and build Trio. Every attempt was made to put messages directly in the script for each step. The next few sections of this page walk you through what you will see when you run the script.
Open Terminal¶
-
On your Mac computer, go to the 'Finder' app.
-
Next, select' Applications' in the navigation pane on the left of the screen.
-
In the 'Applications' folder, scroll to locate and open the 'Utilities' folder.
-
Scroll to and open the 'Terminal' application.
Run the 'Trio Build Select Script' in 'Terminal'¶
The Trio Build Select Script is designed to walk you through downloading Trio. Please take some to read each step carefully.
-
Copy the below script by hovering the mouse near the bottom right side of the text and clicking the copy icon.
-
Paste the 'Build Select Script' into Terminal. Press return to run the script.
-
Running the script will display a series of menu options in the 'Terminal' window, as shown below. To build Trio, you will type 1, and the press return.
-
Next, the script will inform you that you are downloading open-source software. If you understand the warning, you will Type 1 and press return.
-
Next, the script will prompt you to select which Trio branch you want to download. Unless you are actively contributing to app development, you will type 1 and press return.
-
Next, the script will begin downloading the Trio source code. Depending on your download speed, this can take 3 minutes to 30 minutes. While this happens, you may read words in the Terminal window that you do not understand. That is normal. If the download takes a while, you can leave the room and return later to check progress.
-
Once successfully downloaded, your terminal window will appear as below.
-
If you receive a failure message, scroll up through the window to find the error message(s). For assistance, visit Xcode Errors with Build Select.
-
You can hit return to continue if you did not receive errors.
-
Next, we will configure how we sign targets. If you have never built an Xcode app using your Apple Developer ID on this computer, you will be asked how you want to sign the targets the first time you use the script. If you have previously built with the build script, you can skip forward to step 14.
-
If you are building with a paid Apple Developer account, type 1 and press return. If you are building with a free Apple Developer Account, type 2 and press return. Free account users go to Free Apple Developer Account Build now.
-
Once users select option 1, they will be prompted to gather their Apple Developer Team ID. To do so, follow the link provided in the Terminal window.
-
Once you have gathered your Team ID, you can return to Terminal and press return as prompted. The build script will prompt you to enter your Team ID into the Terminal window. Once you have entered the Team ID, you can press return.
-
If you have previously built with the build script, you will be asked to confirm that your Team ID is correct. If it is, you can type 1 and press return.
-
The next question asks if you want to ensure a year with your new build. Unless you have a specific reason, type 1 and press return.
-
In the next Terminal window, you will be prompted to do the following:
- Unlock your phone.
- If you have an Apple Watch, ensure it is unlocked and on your wrist.
- Plug your phone into the computer.
- Press return to continue.
Build Trio¶
-
Next, the script will open the Xcode application. When Xcode first opens, it takes some time for the project and its associated packages to load. You might see a progress wheel with the words 'downloading', 'copying', or 'indexing'.
-
Next, we will set our build destination (a.k.a. your device). At the top of the screen, there is a progress/information bar. To the left of the bar, you will see 'Trio' and the logo. Next to this is your build location. Click this and select the device you would like to build to.
-
We will now build to the location we selected. You can now select the run button.
-
Once you press the run button, you can monitor progress in the information bar.
-
Once the build is complete, a transient message will pop up on the window saying "Build Succeeded." Trio will launch on your phone or build device. You can unplug the device from the computer. When you unplug the device, a message will pop up in Xcode noting the lost connection. Acknowledge this message. Once unplugged, the Trio app will close on the phone, and users must re-open the application.
First Build Messages¶
If this is your first time building an app with this device. You may get some of the following messages:
-
"Device "YOUR DEVICE NAME" isn't registered in your developer account."
- If this message occurs, select 'Register Device', and Trio will continue to build.
-
"Unlock "YOUR DEVICE NAME" to Continue"
- Unlock your device.
-
"code sign wants to access key "access" in your keychain".
- Enter your computer password and press 'Always Allow'.
- Please note: This message may appear numerous times. Do not get frustrated and press 'Deny'. Just keep entering your computer password and press 'Always Allow'.
Build Errors¶
Yellow Errors
If you receive any yellow errors or warnings, don't freak out. This is normal, and Trio will function as normal. Please do not try to fix these errors, as you will likely do more harm than good.
Red Errors
If you receive any Red Errors, your application will fail to build. Please visit the Build Errors page to troubleshoot the errors. Once these errors have been addressed, you can return to the build documents and continue.
Clean Build Folder¶
Once you've resolved a build error and started the build process again, Xcode will continue to show a red indicator on the top line from the previous failure. If you don't like seeing that, clean the build folder to clear the error. Otherwise, Xcode will still work on the build if the steps show across the top line. When the build succeeds, the red circle will disappear.
Clean Build Folder
- In the Xcode menu, select Product, then Clean Build Folder
- Wait for cleaning to complete: you'll see a "Clean Finished" message
Successful Build¶
Congratulations on building Trio, and welcome to the community.
Please see the New User Guide to get started with Trio.
Free Apple Developer Account Build¶
Prepare to Sign¶
You typically get here after choosing to Sign Manually after a successful download using the Build Select script. Normally this option is chosen by people building the app with a Free Apple Developer Accout option or if you want to build to a simulator on your computer.
The instructions found on this page are for the first build. With the Free version, you need to build every week. You cannot build again on day five and hope for another seven days. Unfortnately, it doesnt work that way.
Select the Trio Folder¶
Don't touch that button!
You will be told exactly where on each screen you should click. Please only click in the designated places.
Follow the directions and compare your Xcode screen to the graphics as you walk through the steps.
-
Follow the 'Build Select Script' prompts to open Xcode. Ensure you follow the instructions on each screen.
-
Once Xcode is open, in the navigation pane one the left side of the screen, double click on 'Trio'
-
Next, ensure your phone is set as the build location. If not, click on the build location and select your device from the drop down list.
- If this is the first time your phone or watch has been connected to Xcode, you will need to tell the phone and watch to "Trust this Computer".
I don't see my phone
- If you don't see your phone in the Devices section, unplug and plug in again.
- Still don't see your phone - reboot the phone - and if that doesn't work - reboot the computer.
- Still don't see your phone - try a different cable or USB slot.
Sign Targets¶
What does Signing Targets Mean?
"Signing Targets" in Xcode identifies who built the app. You cannot deploy an app to a phone without signing each target associated with that app.
The graphic below indicates in red the places you need to click in order to begin signing targets.
-
First, ensure the target 'Trio' is selected.
-
Next, we are going to select the 'Signing & Capabilities tab.
-
We will then filter the capabilities to 'All'
-
Next, please check 'Automatically manage signing' option.
-
You can now add your 'Team'. Click the drop down box and ensure you select your free team.
-
Repeat the same steps for the remaining targets.
Disable Features¶
This section is required if you are using the free account. Some features of Trio are not available with a free Apple Developer Account. You will need to remove features that are not supported.
-
You must remove unsupported capabilities from 2 targets. This is best done as you sign each target:
- Trio Target: Push Notifications; Siri, Near Field Communication, and Time Sensitive Notifications
- Trio WatchKit Extension Target: Siri
-
Add the
SIRI_DISABLED
keyword to the ConfigOverride.xcconfig file:- Click on the filename in the left pane of Xcode and view it in the Xcode editor
Details about removing unsupported capabilities:
- You must disable Push Notification, Siri, Near Field Communication, and Time Sensitive Notifications
- If the target you are signing does not use one of these attributes, no error message will appear when you select (personal team) for that target
- If the target you are signing does use one of these attributes, an error message will appear when you select (personal team) for that target
- The Xcode error message starts with "Cannot create . . ." with a list of all the attributes not supported.
- Scroll down and click on the little trash can icon next to each unsupported attribute
- Scroll up and both the "Cannot create . . ." and "No profiles for . . ." error messages are gone
- You are done with this target
- Proceed to the next target
Libre Transmitter not supported with a FREE Apple Developer Account
Libre transmitters require Near Field Communication (NFC) for background tag reading.
❌ This capability is not available when building Trio with a free Apple Developer Account.
You need a paid Apple Developer Account for that.
End of Free Account Steps¶
You have now completed the additional steps required for building with a free Apple developer account. You can return to Build Trio and complete the remaining steps.