Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developing for iOS on multiple computers, testing on a single device, advice?

I was looking for some advice on provisioning profiles / certificates etc... I use an iMac at work to develop on, and I also sometimes find myself checking out my code from git onto my MacBook Pro at home but I always run into issues when I want to test on my iPhone from another computer.

Obviously my provisioning profiles on the device match the certificate issued to my iMac from work, so from my laptop, I can't test on the device because the provisioning profile doesn't match a certificate. so I get a code sign error.

What can I do to bypass this ?

Thanks in advance.

like image 591
Daniel Avatar asked Aug 14 '11 15:08

Daniel


People also ask

How can I test my iOS app on a real device?

Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen. Plug your iPhone into your computer. You can select your device from the top of the list. Unlock your device and (⌘R) run the application.

What certificate are required for running the app on device in iOS?

A signing certificate with the public and private key. On iOS, iPadOS, watchOS, or tvOS you need a distribution certificate; on macOS you need a development certificate.

How do I add a test device to Apple Developer?

If you need to add a testing device, you should go to developer.apple.com -> Member Center -> iOS Provisioning Portal -> Select Devices on the left tab menu-> Press Add Device button -> insert test device UDID and save this new device.


1 Answers

Apple provides an easy solution to working on multiple machines.

You can export your developer profile from your work iMac and move it onto your Macbook Pro.

  1. In Xcode 4, bring up the Organizer. Click on "Devices"/

  2. Now, click on "Developer Profiles" in the sidebar.

  3. Then, on the bottom of the screen you will see a button called "Export" and a button called "Import". On the computer with the original certificates click "export" and save the profile. You may be prompted to enter a password.

  4. On the second computer, use "import" to install the certificates.

Exporting a developer profile

You should be able to develop and test seamlessly between the two machines now.

Edit:

According to Topher Fangio in the comments below, you may need to:

open Keychain Access, then find [your] iPhone Developer Certificate on my desktop, and export it. Then import it on your [second machine]. If you see the dropdown and associated private key on one machine, but not the other, then you need to export it apparently.

Hopefully Topher's insight will help anyone who has trouble with using Xcode to do this.

like image 56
Moshe Avatar answered Oct 09 '22 01:10

Moshe