How to install an unsigned IPA file on my device using an Apple Developer account? - ios

I need to install an .ipa file that I own onto my device, an iPhone 5.
I have the device, the iOS developer account (complete access), Xcode, etc. Now, how should I "codesign" it, add certificates, provisioning profiles and finally how do I install it in my device?

Since you have an .ipa, what you need to do is extract the .ipa (basically a ZIP file), pull out some files related to the old signing, swap in your new provision profile, and then re-sign. Simply zip it back up and you should be good to go.
IPA="/path/to/file.ipa"
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in keychain
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# sign with the new certificate
/usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
This is all assuming that you're not trying to change the bundle ID or anything with entitlements. Note that the new profile must have the necessary entitlements for this to work on a device.
For a pre-made script that also does this, see the following:
https://github.com/RichardBronosky/ota-tools

I got very nice linked from internet that you can create certificates, provisioning profile and co-design using following steps.
As you said you have complete access of you iOS developer account with 99$ yearly subscription. then you have to your system.
Create Developer cer from you with your certificate signing request or CSR. Download it and install it in to you key Chain by Double clock on Cer. that shoul appear in to you keyChain like following screenshot with private key. If with your Dev cer if there is no private-key then there is some mistake in to you system authority cer.
Now for testing app in to your device you have to add your device UDID in to this dev cer. You cannot run an iOS application on a random device. You need to specify on which devices your iOS application should run by adding one or more iOS devices to the iOS Dev Center.
Browse to the Certificates, Identifiers & Profiles section of the iOS Dev Center, click the Devices tab in the iOS Apps section, and click the plus button in the top right. To register a device, enter a name for the device and he device's UDID. The UDID is an identifier that uniquely identifies an iOS device. Note that the UDID is not the same as the device's serial number.
You can find the UDID of a device by connecting the device with your machine and launching Xcode's Organizer. You can open the Organizer by selecting Organizer from the Window menu. Select the Devices tab at the top and select the device you're interested in. The 40 character alphanumeric string next to the label Identifier is the device's UDID.
After add your device UDID then you need to create AppID for you application. To create a new app ID in the iOS Dev Center, navigate to the Certificates, Identifiers & Profiles section, click iOS Apps, and choose App IDs from the menu on the left. To create a new app ID, click the plus button in the top right. like following screenshot
After cratering AppId then you need to Create a Provisioning Profile that use for code Signing. With the development certificate and the app ID in place, it's time to create a provisioning profile for your application. Before we start, it might be useful to explain what a provisioning profile is, because this is something that confuses a lot of new iOS developers.
It will become clearer if we create a provisioning profile for your application so let's do that now. In the Certificates, Identifiers & Profiles section of the iOS Dev Center, select the Provisioning Profiles tab in the iOS Apps section. Click the plus button in the top right to create a new provisioning profile. Select iOS App Development in the section labeled Development and click Continue. like following screenshot:
Click on continue In the next step, select the app ID you created a few minutes ago.
Select the development certificate from the list of certificates to associate the new provisioning profile with the correct certificate and click Continue.
You then need to select the devices you wish to link to the provisioning profile. Remember that only these devices will be able to run your application during development.
Give the provisioning profile a descriptive name so you can easily find it later. Click Generate and download the provisioning profile to your development machine. Double-click the provisioning profile to add it to Xcode.
Open the Xcode project that you created during the previous tutorial and select the project from the Project Navigator on the left. Select the first item in the list of targets and click the tab labeled Build Settings at the top. search for the subsection titled Code Signing Identity
After setup code sign, certificates,provisioning profiles create IPA by select device that connected Via Cable with Xcode. Run your project with your Device.
For Creating IPA Go to Top Bar of mac-screen--->Product-->Archive like following screenshot.
This process might be take some time for creating Build wait a while then you got new window with look like following.
Tap on distribute Button you get multiple option like following screenshot:
You have to select second option as same as above screenshot and click on Next Button. Then next screen with one drop-down. Select correct Identifier that you are using as a code sign And click on export.
After some process there is one window appear for location of save ipa file like following screenshot.
Yuhoo your IPA file is created now you can install by many thing for example using iTunes, using Test Flight using Diawi

Related

Manually create provisioning profile in Xcode

I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
So, I was trying to use the Pythonista Template in Xcode, and I wanted to flash it to one of my devices so that I could test it on a real device and not just the iOS simulator.
So I enter in what I want the app ID to be, and it says, No profiles for 'com.cartercoding.getnpostserver' were found. So I need to manually create a provisioning profile for it, which I have looked up, but the answers I have found are not relevant.
I am using Xcode 11, stable release.
I don't really know what a provisioning profile does...
A provisioning profile grants permission for one or more iOS devices to run an app signed with a specific certificate. Normally, an iOS device will only run apps that are signed by Apple; a provisioning profile tells the device that it may also run apps signed with a key corresponding to the certificate specified in the profile.
I am trying to put an app that I downloaded from the internet on my phone, so I can't do it the usual way.
The whole iOS code signing infrastructure is designed to prevent you from doing that. Short of jailbreaking your device (which is a whole other conversation) you can't just install an app that you've downloaded onto your phone.
I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
You can't create a provisioning profile "manually," if by that you mean to construct one on your own; you have to get one from Apple (whether that's automatically through Xcode or via the developer portal).
For users who need to manually create a provisioning profile (in some companies every app has to have its own provisioning profile)
Sign in to your Apple Developer account and navigate to Certificates, IDs & Profiles > Identifiers > Provisioning Profiles.
https://developer.apple.com/account/ios/profile/production
Add a new provisioning profile.
Activate App Store.
Click Continue.
From the dropdown menu, select the app ID you just created.
Click Continue.
Select the certificate you just created.
Click Continue.
Fill in a name of your choice. The name is not visible to end users.
Click Generate.
Download the provisioning profile.
Click Done.
The provisioning profiles overview with your new provisioning profile is displayed.
If you need a Provisioning Profile of Type Ad Hoc
Is everything the same except point 3
These instructions were copied from this page
https://support.staffbase.com/hc/en-us/articles/115003598691-Creating-the-iOS-Provisioning-Profiles

Distributing to client via IPA with UDIDs?

A client is asking me to send an IPA file to them.
"You can send the file via email and it can be installed as a developer device"
I tested creating an IPA file for the project and archived it allowing XCode to automatically manage signing. This, as expected, only has my one device's UDID stored in the IPA.
I've gone into the apple developer portal and created an Ad-Hoc provisioning profile for this app. I am not seeing how to add in devices to the profile. When I go to edit the profile, the devices only show the option to select iPhone, Mac, or both.
I'm using Testflight, but the client also wants the IPA.
How can I correctly create an IPA file of my project with the provided device UDIDs?
Log into your apple account and go inside "Certificates, IDs and Profiles" section. There you'll see a section named "Devices", select the option "All" under it. Now you'll see + button top right corner, press it and add the udid of your client and name that device whatever you want and press continue.
Now open your xcode,
press the small i button in front of provisioning profile and drag and drop your provisioning profile (circled in black) anywhere on your desktop. Check the name of your provisioning profile and now go to Library / MobileDevice / ProvisioningProfiles. There you'll see all your provisioning profiles. Now just delete the one that has same name as the one that you just dropped on the desktop. After that Xcode will automatically generate the new provisioning profile for you with all the newly added udids inside it. Now you can archieve your project and generate the ipa file. It will now run on your client's device.
P.S. instead of doing all this you can also generate a new provisioning profile from your apple account and double click on it to insert it into xcode.

IPA file extraction

How to extract IPA file from project to run it on a real device to check the functionalities .I'm extracting it through the product folder and compressing it but it is showing error in iPhone that this file can't run.
To test an app on real device ,you must have development and adhoc provisioning profile for the app.
To know how to create certificates and provisioning profile, you can check this link: App id, certificates and provisioning profile
Then set the provisioning profile to your app target. If everything is right so far, then create an archive by Choosing Product -> Archive in Xcode and follow the steps. When Organizer window open in this process, tap on Export, appears on the right side of the window to extract the IPA file.
To test your app on real device you need a developer account,once you got a developer account just go to general on project target and enable automatic signing,it will create automatic provisional profile and certificate for you.i will let you know the steps below.
1)Get developer account with 99 dollars per annum.
2)Import your developer account by selecting Xcode->Preferences->Accounts and add your account by entering account name and password.
3)Now goto general and enable automatic signing,it will register your device and create provisional profile with certificate automatically.
4)Clean build and run your project with your device by connecting to Xcode.
Enjoy.....
You need to reverse work .
1 . You need to change .ipa extension to .zip
2 . Now you can watch .app file now drag this file to your device from Windows > Device
Another way for creating of ipa
If you want to work this ipa file then you need to create ipa as below:
Add necessary profiles and adjust build settings.
Set device as target to run the application.
Build the product.
Go to Products->yourAppName.app. Right click and show in finder.
Drag & drop to itunes profile and binary file.
Select app in iTunes and right click to show in Finder. And there you can get the .ipa file.

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.
In Xcode, add your Apple ID to Accounts preferences, described in
Adding Your Apple ID Account in Xcode.
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.
Connect the device to your Mac and choose your device from the
Scheme toolbar menu. Below the Team pop-up menu, click Fix Issue.
Xcode creates a free provisioning profile for you and the warning
text under the Team pop-up menu disappears.
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.
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

iOS: Bundle format unrecognized, invalid, or unsuitable

When I try to run an iOS app on real devices it give me the following error, but it works on simulator, also I uploaded test build on TestFlight successfully, I tried to use another bundle identifier but no luck.
The project is built using Swift and using CocoaPods to include Alamofire and other libraries.
Without having all the details it sounds like you need to update your Provisioning Profile for Distribution or Development.
You will first need to go to the Apple Developer portal and login in to your account. Then select "Certificates, Identifiers and Profiles", followed by "Devices". Add your iPhone's name and UDID to the list if it is not there already.
After your device is registered to your account you will need to update the Distribution Profile (to allow devices to open your app through the beta distribution channel of Test Flight) as well as your Development provision profile to allow team members to build and run the app through xcode on their device instead of the simulator.
First select Distribution and click on the preexisting Distribution Profile for your application. Select the edit option and make sure the check mark next to your device is selected. Then generate a new Distribution profile. This will cause a download to automatically occur in your browser window. Once its complete you should click the download and this will automatically add it to xcode.
Now create a new provisioning profile for your application. Add the appropriate App Bundle Id and select your device from the list. Generate the new profile and a download will again be triggered in the browser window. Once the download is complete again click the download which will automatically add the profile to xcode.
Your application should now be able to run on your device when building and running through xcode as well as when it is downloaded from your beta distribution channel.

Resources