Search code examples
iosprovisioning-profilexcodebuildipaself-signed

How to run iOS application in real device through terminal without a paid apple developer account?


First this not duplicate of Test iOS app on device without apple developer program or jailbreak

I know it is possible to run app on device using Xcode 7 and free AppleId but i want to achieve this using terminal only Or in other words, Is there any way to generate provisioning profile & certificate using unpaid Apple Id through terminal.

If i will follow mentioned steps then my app installed and run successfully in device but i want to generate IPA using this free certificate and provisioning profile using terminal only.

  1. In Xcode, add your Apple ID to Accounts preferences, described in Adding Your Apple ID Account in Xcode.
  2. In the project navigator, select the project and your target to display the project editor. Click General and choose your name from the Team pop-up menu.

  3. Connect the device to your Mac and choose your device from the Scheme toolbar menu. Below the Team pop-up menu, click Fix Issue.

  4. Xcode creates a free provisioning profile for you and the warning text under the Team pop-up menu disappears.

  5. Click the Run button. Xcode installs the app on the device before launching the app.

I am working on some automation task and want to generate and install this signed iPA using unpaid Apple Id through Terminal.


Solution

  • I do not believe this is possible. The challenge is not just extracting the provisioning profile that is created in Xcode. That will not work because Xcode also manages the devices in the profile. So if your devices change, you need Xcode to register the new device and add it to the profile on Apple's servers, before re-downloading it. It also manages the bundle ID.

    In theory, if you were to set up the app and all devices in Xcode before grabbing the provisioning profile from ~/Library/MobileDevice/Provisioning Profiles, maybe it would work.

    If you can successfully get the profile. maybe you can use these instructions to build and install on the device as long as it was set up ahead of time: install application in iphone device through command line