How to use Xcode 10 Xcode Server
Integrated in Xcode
We don’t need to install OSX Server. Xcode Server is now integrated in Xcode
Login with GitHub SSH
Xcode 10 chooses default git remote. If we need ssh, need to run git remote remove https and git remote add ssh url
Generate ssh key https://github.com/onmyway133/blog/issues/235 Then when creating Xcode bot, Xcode automatically chooses ssh url and selects correct public key file
CocoaPods
Simply pod install gives Trigger Error: Trigger exited with non-zero status 127. 😢 127 status code means command not found
Specify full path /Users/khoa/.rbenv/shims/pod install gives Trigger Error: Trigger exited with non-zero status 1
👉 Need to cd. When Xcode Server clones the repo, it does not cd into that folder, so we need to cd first
cd MyApp
pod install
Troubleshooting
Can’t build
👉Select the correct branch for Xcode bot
The xcodebuild task completed with uncaught signal (status 6)
👉 Don’t use device
Failed to create a bundle instance representing
👉May disable Analyze and Archive step, as they are not needed for now
Wrong target
If we run on 1 device and no simulator, the errors become clearer
Error: Testing cancelled because the build failed.
Error: No account for team "X5KNCMNABC". Add your server to the team in the bot editor. (in target 'MyApp Production')
Error: Provisioning profile "iOS Team Provisioning Profile: no.MyApp.MyApp" doesn't include the currently selected device "Khoa sin iPhone". (in target 'MyApp Production')
Error: Your development team has reached the maximum number of registered iPhone devices. (in target 'MyAppUITests')
Error: Provisioning profile "iOS Team Provisioning Profile: no.MyApp.MyApp.MyAppUITests" doesn't include the currently selected device "Khoa sin iPhone". (in target 'MyAppUITests')
Xcode Server is trying to build for production scheme too
👉I have staging and production targets with different Apple team. Select production Apple team for Xcode server too (Edit bot) 👉Disable tests in production target (Production scheme -> Edit -> Test) 👉Select correct team for staging target