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

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

Related

How can I test ios app i coded on Xamarin.Forms on Windows 10 using a real iPhone iOS device?

Currently i don’t have apple developer account. I am developing on Xamarin.Forms in Visual Studio 2019 on Windows 10. I also have a mac device. I installed xcode on this mac. I run simulators on windows by the help of this mac connection. But i want to test my app on real iphone. How can i do this ?
You cannot run your development app on iOS device unless you have an Apple developer account. After you create the account, you need to create provisioning certificates for the device, download them. Only then you can run it
To be able to deploy on a physical iOS Device, you either need to have an Apple Developer Account or you can get a free provisioning profile from XCode (No Apple Developer Account required).
To get a free provisioning profile,
You have to (on your Mac):
Open XCode > Preferences and add your Apple ID in the Accounts section. You can then close the Preferences tab.
Create a new project and select Single View App. In the Team drop-down list, set it to the Apple Id you just added.
After the creation of the project, target your iOS device for building.
Open General > Identity and make sure the Bundle Identifier matches the one found in your info.plist directly from your Xamarin.iOS app.
Under Signing, select Automatically manage signing and select your Team.
You should now be able to see your provisioning profile when clicking the 🛈 symbol under Signing - Provisoning Profile and you can test the deployment by clicking the run button.
To deploy your app from Visual Studio:
Make sure your Visual Studio is paired to the Mac.
Connect your iOS Device to the Mac
Navigate to iOS Bundle Signing in Your iOS Project > Properties.
For Configuration, select Debug.
For Platform, select iPhone.
Select Manual Provisioning.
Select the provisioning profile and the signing identity created by XCode
You should now be able to run the app. (Don't forget to target your IPhone for Deployment)
For more info, visit (https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/free-provisioning?tabs=windows)
Plug your phone into your computer using a USB to Lightning connector. Click Trust on your phone. Click on the simulator on XCode and choose your phone name. Click build. You will get an error on your phone saying untrusted developer. Go to settings on your phone, click general then profiles. Click on the only one there and click trust. Now you can open your app.

Firebase App Distribution - "Waiting for developer" message

I'm developing an iOS application and using App Distribution to distribute my test releases to QA Team, I didn't had any problem before, everything was smooth and pretty (estrange considering iOS development hehe)... but recently I face a problem that I can't resolve and I didn't found any documentation about it.
I constantly adds new Testing devices to the project (as the QA team grows) and follow the same steps...
Adds the new account to my tester list in Firebase.
Get the register attempt with the UDID of the new device.
Register the new device UDID in the Apple Developer Console
Distribute a new release of the app through App Distribution.
Install the certificate in the device
And voila, download the new distribution.
But this case is different... because in this iPhone XS Max with the latest iOS version, the download button never appears, and we just can see the following message: "Waiting for developer".
I try a lot of different solutions, redownload and import the Profile, to redistribute the app, create new profiles, force new devices in Fastlane, delete and readd the UDID in developer console... dammit... I create new certificates in my rage hahaha... but the problem persist, anyone face this problem before?
Update
I sent a ticket to Firebase support center, and they told me that the UDID wasn't in the distribution profile, so my solution was recreate the profile, because download and import the ad-hoc profile didn't work.
This issue isn't a Firebase problem, it was a classic issue related to iOS signing hell.
I had the same problem when tried to add device for Firebase Testing.
I made all instructions from Firebase troubleshooting.
If you're installing an Ad Hoc distribution, the Waiting for developer
button appears when the developer hasn't yet configured their app to
run on your test device. To make their app available to you, the
developer must complete the following steps:
Add the test device's UDID in the Apple Developer portal (the UDID is emailed to the developer when you register the device to
Firebase).
Include the device in the app's provisioning profile.
Build the app using the updated provisioning profile.
Distribute the new build using the Firebase console, the CLI, or fastlane.
https://firebase.google.com/docs/app-distribution/troubleshooting?platform=ios#waiting-dev-ios
Than I noticed that all of my provision files (for me it was folder /Users/user/Library/MobileDevice/Provisioning Profiles) not include UDID of new device. Every file can be previewed if you will choose view mode or right click on it, select "Get Info" and expand "Preview" block. If you will scroll to bottom you will see block "PROVISIONED DEVICES" with codes of your devices.
For me the problem solved when I found files which descriptions had "IOS Team Provisioning Profile: my.bundle.name" and "Developer Profile Name: my.bundle.name" ("Developer Profile Name" is profile name which you see in your Profiles list at https://developer.apple.com/account/resources/profiles/list).
I moved 2 files (which descriptions started from "IOS Team Provisioning Profile: my.bundle.name" and "Developer Profile Name: my.bundle.name") from /Users/user/Library/MobileDevice/Provisioning Profiles to another folder (I was afraid to lose it and not removed, just moved)
Opened XCode
Selected menu XCode -> Preferences
Selected Accounts
Chose my e-mail account name
Selected MyTeamName and clicked button "Download Manual Profiles"
Selected my Personal Profile and clicked button "Download Manual Profiles"
After it in the folder "Provisioning Profiles" appeared two new provision files and I found the name of my device in the bottom of their descriptions.
Than i cleaned project rebuild app-file and distributed it on test and all worked.

Xcode 8 asks for a device to be registered to create provisioning profile

I am trying to publish an app for testing, without having to connect a device in my mac.
I have created a developer account, created an app in itunes, generated bundle id, signed into xcode with the developer account, generated a distributor certificate.
When I tried to archive the app, I got the error "conflict provisioning setting. app is automatically signed for development ..."
I read in this post and followed the tip of unchecking and rechecking the option "Automatically manage signing". After re-choosing my team, I get the error "There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it".
The goal all along was that I wouldn't need an ios device, because I intended to immediately publish the application and invite people to test it via testflight. Is it not possible to do it like this? Am I missing something.
I have read lots of documentation, but being a first timer in this, everything seems confusing.
Edit: I created a provisioning profile as distributor. Even after creating and installing the distributor profile (it now appears also in xcode at Account -> provisioning profiles), I still get that same error. I also noticed that in signing, The signing certificate is iOS Developer. I am sure
I fixed it by plugging in my iPhone and going to the Product menu > Destination > iPhone (my device).
Then after clicking Try Again on this properties page the warnings went away.
Source
The solution (though I would welcome more elaborate, insightful explanations):
#General -> Signing, disable the option "Automatically manage signing"
#General -> Signing and certificates choose your team
Though in my case that was not the issue, I would recommend making sure that in the device list, you choose Generic iOS device in your target devices.
This really sucked to figure out.
What you do is add a distribution profile in https://developer.apple.com/account/resources/profiles/add. Don't choose development! Don't let the Xcode Automatically manage signing!!
Then, you download the provision.
Then, in the Signing & Capabilities -> Signing Section of the project.xcodeproj file, turn off Automatcially manage signing, choose import and import the file you just downloaded.
Then, in the top, you choose Any iOS Device (arm64, armv7) and then you go Product -> Archive.
What happened to me was that I was about to run my app on a physical device for the first time and I didn't have a Team. So I created it in the process before connecting my phone with the USB cable. After I created the team a message like the listed above appeared. I did some research on internet but nothing found.
So here's what I did: I connected my phone, did all the trusted process, then restarted Xcode, and it worked. I am not sure what happened, but it was some of my first experiences using Xcode. It could sounds silly but it helped me. Hope to you too.
If you do not wish to register a device follow this advice:
https://stackoverflow.com/a/44157307/499581
* In short use "Generic" as the device while archiving.
If you do wish to register a device then the solution to:
"There are no devices registered in your account on the developer
website. Plug in and select a device to have Xcode register it".
Is to physically plug-in your device (an actual iPhone, or iPad) so that Xcode can register it for development use (note: this will not affect the normal everyday use of the device). After the device is registered it can then be used for development testing, load provisioning profiles onto it, etc.
↳ Disabling and Enabling Devices Using Your Developer Account
For those who are trying to develop without a mac computer using MacInCloud don't follow the standard advice out there. Its will lead you down a hole. I have wasted hours of my time.
The reason it say something about "a device to be registered to create provisioning profile" is that you need to provision an iOS device that you can test on before you can get it signed. If you are using MacInCloud you probably can't physically connect an iPhone or iPad to the MacInCloud and therefore it can't automatically provision devices for you.
Before you get to far into this you will need to get your iPhone/iPad UDID. Which I was able to do with https://get.udid.io/ on my iPhone, but it didn't work on my iPad. Instead, with the iPad I had to download iTunes from the Windows store and connect my iPad. Then click on the little gray square in the menu that's inline with Library tab.
image of itunes
Then when it pops up with your device info (mine didn't come up with my info at first, I had to sync my device). You will see your SN. Click on your SN and it will change to your UDID. Once you have your UDID you are ready to create a provisioning profile. What is confusing is this isn't done in the appstoreconnect section of your account online. Its done in your developer account: https://developer.apple.com/account
developer.apple.com account screen shot
When you go there you will want to click: Certificates, Ids & Profiles
Here you will need to add your devices and then with auto signing checked in Xcode that made the problem go away. NOTE: I originally tried to create a profile, download it, and import into Xcode under the Provisioning Profile dropdown in Signing & Capabilities. As described in another answer here, but that proved more problematic and wasn't necessary.
Then you can chose Any iOS Device from emulator device drop down then go to Product > Archive > Distribute App and create a certificate to place it on the app store (TestFlight).
you can also plug an iphone, run the app the app on your iphone as the target, it will ask you to register the device and then the certificates will be generated
Have you paid the $99/year developer fee? TestFlight is only available for paid developers. I would highly recommend plugging in an iOS device, though. It's more fun and rewarding testing that way.

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.

Run xcode project with distribution profile on it

I have created an iOS application, and wanted to submit it to the App Store.
I saw a tutorial on how to do that, and understood that I need to create a Distribution profile and replace it with the Development profile. So I did that but before sending it to the App Store. I want to check it last with that profile on it (the distribution profile).
Can I run Xcode project when I add a distribution profile?
because when I tried running it on a real device, an error popped up: "the provisioning profile "XXXXX" was not found".
So i went to the Devices tab and tried adding the file of the provisioning profile, and it didn't allow me to.
What should I do?
You can't use distribution profile to run the app on your device directly from your device.
Now Apple provides beta testing of apps using iTunes Connect. So you can opt for that option as an alternative.
Refer Beta Testing Your iOS App for more details
Yes, you can do by applying small tweak.
Open you Xcode project
click on your target.
choose edit scheme from list.
choose Run tab from left.
select info tab from top.
select Build Configuration and choose release from drop-down list.
Now delete your existing app, from device if exist.
And run the app from Xcode.
After completion of compiling for app, it would show some error dialog and will stop execution, ignore it.
Now app is installed on your device with distribution profile.
Re-run the app.
Cheers!

Resources