I upgraded my iPhone 11 to iOS 14 today and got the message “iPhone is not available. Please reconnect the device.” when trying to send an app to it from XCode 11.4.1.
The message doesn’t really match the problem, as the problem was actually that I needed to install XCode 12 in order to support iOS 14. XCode 11 doesn’t support iOS 14.
Quick fix; install XCode 12
So, this one solves a bug in Unity 2017.4.2f2 that causes the armv7 device capability to be added to a 64 bit only build. We actually want arm64 instead of armv7 so I’ve setup this little hack to handle the fix
// This has been added as a patch to solve a bug in Unity 2017.4.2f2 that incorrectly adds armv7 instead of arm64 to the plist
// ...and no, I don't like doing this.
public class PatchArchitecture
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
if (target != BuildTarget.iOS)
string filePath = Path.Combine(pathToBuiltProject, "Info.plist");
PlistDocument plist = new PlistDocument();
PlistElementDict rootDict = plist.root;
// Get or create array to manage device capabilities
const string capsKey = "UIRequiredDeviceCapabilities";
capsArray = rootDict.values.TryGetValue(capsKey, out element) ? element.AsArray() : rootDict.CreateArray(capsKey);
// Remove the armv7
const string arch = "armv7";
capsArray.values.RemoveAll(x => arch.Equals(x.AsString()));
// Add the arm64
#endif // #if UNITY_IOS
So, I’ve been working on an iOS project in Unity and wanted to build on a PC and just use a Mac for the signing step. This allows me to throw processing power at the build (the PC) and just use a low-end Mac Mini to handle the less labour intensive signing.
Technically, a Mac isn’t needed in the pipeline (PC’s can handle the sign) but I’m still a bit sceptical about signing final release builds on a PC, and would prefer to keep things safe by signing on the hardware and tools that Apple recommends.
Quick tutorial on setting up an OSX slave that can be used from the PC…
- Setup Jenkins on PC and Mac (I’m using 2.102 and it’s quite stable)
- Add a Slave Node
- In Jenkins, go to Manage Jenkins->Manage Nodes->New Node
- Enter a name (“Slave OSX” or similar)
- Select “Permanent Agent”
- Click “OK”
- On the page that follows (See below): –
- Set the Remote Root Directory for the slave (For me it’s /Users/Shared/Jenkins/slave)
- In Launch Method, select “Launch slave agents via SSH”
- Enter the IP of the slave
- Click “Add” on credentials to enter credentials that will allow your PC to connect to the Mac (See below for more info)
- Under “Host Key verification Strategy” I use “Manually provided key Verification Strategy”. Note: This is the rsa key of the Mac you’re connecting to. It IS NOT the rsa key needed to connect to the Windows PC. The rsa for the slave Mac can be found by typing “ssh-keyscan -t rsa [IP of Slave] on a terminal session on the slave Mac
As mentioned above in point 3.2.2, the credentials for connecting to the Mac have to be set up. After clicking the “Add” button do the following: –
- Set the scope to “System”
- Add the username that you’ll be using to log in to the Mac
- Set the private key to the private key generated for this PC. See my other post here to get info on how to do this. The same post will talk you through configuring the Mac to work with password-less access via an authorized_keys file
And that’s it. When you launch the node it should connect to the Mac and you’ve got a Mac slave. I’ll add another post on how to setup the signing soon.
We want to be able to login to a mac using ssh but don’t want to type a password every time. This is done by allowing Remote Login for a given user on the Mac and adding a public key to the Mac for the PC you’re logging in from.
- On the mac, make sure the user allows “Remote Login”. You’ll find this in Settings->Sharing
- Tick “Remote Login” and make sure the user you’re logging in as is included in the list on the right (click the ‘+’ if not)
- Open a bash commandline on the PC (Git Bash will do the job)
- ssh-keygen –t rsa
- press Enter until the command exits (passwords etc all blank)
- You now have a public key for the PC
- ssh to the mac
- ssh [user]@[IP] (in my case, ssh jenkins@JENKINS_SLAVE)
- Make sure you have a .ssh directory in the home directory (the one that you’re in straight after logging in). If not, mkdir .ssh
- Open another bash commandline on the PC
- cd to the directory where the id_rsa.pub was created. In my case: –
- cd /c/Users/andygreen/.ssh
- Copy the .pub to the mac
- scp ./id_rsa.pub jenkins@JENKINS_SLAVE:/Users/Shared/Jenkins/.ssh
- Go back to the bash session that’s logged into the Mac and copy the public key to an “authorized_keys” file so it’ll be checked when logging in
- cd .ssh
- cat id_rsa.pub >> authorized_keys
That should do it. The next ssh jenkins@JENKINS_SLAVE will login without asking for a password
Also, worth noting that Sierra or above will need to be a 2048 bit rsa or they won’t work. See here for more info
Best explanation I have for this one is that it’s caused by using an Adhoc provisioning profile to launch a build from XCode. The Adhoc profile is seen as a distribution build so Apple won’t allow you to debug it directly.
You are still able to send the build to the device and launch on the device, but XCode won’t play nicely with it.