How do I avoid XCode 10.1 installation errors?
I have an iMac that can't run MacOS later than High Sierra, so it's running 10.13.6. A year or so ago I was using Xcode 9 (can't remember what version) to develop a Mac app and now I want to do iOS development. I read that I can use Xcode 10.1 on my machine, so I updated my developer credentials and certificates, and then downloaded the Xcode 10.1 (it's big!!) and installed it after a restart of my iMac. So far so good, but when launched it asks for permission to install additional components. I agree, but then get this
"An unknown error occurred. See the install log for more details."
I looked at the install log but I can't understand it. I include it below. What did I do wrong? Perhaps some old stuff is inhibiting the installation, but what and where? Can anyone help?
2020-04-08 20:58:24+02 Grahams-iMac deleted[457]: diskmanagement: [DMManager(PrivateMethods) clientConforms:error:]: currentThread=14783=0x39bf expectedThread=20483=0x5003
2020-04-08 20:58:33+02 Grahams-iMac system_installd[687]: PackageKit: Adding client PKInstallDaemonClient pid=1026, uid=501 (/Applications/Xcode.app/Contents/MacOS/Xcode)
2020-04-08 20:58:33+02 Grahams-iMac installd[689]: PackageKit: Adding client PKInstallDaemonClient pid=1026, uid=501 (/Applications/Xcode.app/Contents/MacOS/Xcode)
2020-04-08 20:58:33+02 Grahams-iMac Xcode[1026]: Package: PKLeopardPackage <id=com.apple.pkg.MobileDeviceDevelopment, version=10.3.9000000000.1.1488876279, url=file:///Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg> Failed to verify with error: Error Domain=PKInstallErrorDomain Code=102 "The package “MobileDeviceDevelopment.pkg” is untrusted." UserInfo={NSLocalizedDescription=The package “MobileDeviceDevelopment.pkg” is untrusted., NSURL=file:///Applications/Xcode.app/Contents/Resources/Packages/MobileDeviceDevelopment.pkg, PKInstallPackageIdentifier=com.apple.pkg.MobileDeviceDevelopment, NSUnderlyingError=0x7fa694a92220 {Error Domain=NSOSStatusErrorDomain Code=-2147409654 "CSSMERR_TP_CERT_EXPIRED" UserInfo={SecTrustResult=5, PKTrustLevel=PKTrustLevelExpiredCertificate, NSLocalizedFailureReason=CSSMERR_TP_CERT_EXPIRED}}}
iMac 21.5", macOS 10.13