In Xcode, how can I register a device to test on it, without having a paid Apple Developer account? - ios

I am trying to test an app in a real device, using XCode 9.
In Xcode > General > "Automatically manage signing" I get this error: Failed to create provisioning profile. There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it.
I have tried physically plugging in an iPod, an iPad and an iPhone. They all show up in iTunes, and also in XCode under Windows > "Devices and Simulators", but XCode simply doesn't register anything.
I also tried to go to the website to register the devices manually, but it seems I cannot even access this website without having a paid Apple developer account?
I do NOT have a paid Apple developer account, but I do have the Apple ID. I know that I can test in a real device without an account because in this page https://developer.apple.com/support/compare-memberships/ under Benefits and Resources the Sign in with Apple ID column has Test on Device checked.
Please, how can I solve this?

At the top of the Xcode window, from left to right, after the Run and the Stop buttons, there is another button which displays the tooltip "Set the active scheme" when you hover the mouse over it.
This button lets you choose a simulator. But once your device is plugged in it also let you select that device. Once you select your device, the problem disappears.
Note to those using Xcode to run code developed for Google's Flutter: You probably must also select Product > Run in Xcode, before you are able to go the device to trust the certificate, under the device's General > Device Management.

What I normally do when I test on a device is by selecting general device before I archive the build, and then after you follow the prompts after the build, choose install on a device.
If you are really set on just being able to run directly without archiving, make sure that you are signed in with your apple id (the only reason you would need to pay would be if you are submitting to the app store, so you don't have to worry about that) under accounts (XCode -> Preferences -> Accounts), and then replug your device.
And if that doesn't work, try following the instructions on this site: https://help.apple.com/developer-account/#/ under Registera Single Device.

Related

How do I run an app on a device without an Apple developer account

I've found several sites with information on how this can be done, but none that seems to apply to Xcode 10.1 or iOS 12.1. The ones I've tried don't seem to work.
I've tried this:
Create an empty swift project 'single view app'
Set the Signing Team to my Personal Team (Apple ID)
Set the active scheme to my connected (USB) iPhone 7 plus
Press the Play button
What I get is a 'Failed with exit code 1' and a horrendous log message.
My device turns up with a red frame in the active scheme dropdown list. What does that mean?
I'm running a MacBook Air with High Sierra.
Any help is appreciated.
You need to only have a free account then add it to
Xcode->Preferences->Accounts
after that select it in automatic signing process , then you'll get a trust message upon first run to fix go to
Settings->General->Device Managament -> Your profile name -> Trust
then re run
You just need to have apple developer account, which is free. If you don't have that create a using this link:- https://developer.apple.com
Go to Xcode -> Preferences -> Accounts, login with your developer account, and download profiles.
Select your project, Go to general tab, select automatically manage signing and Team as your personal team.
Run your project, After successful build. you will get an error in Xcode stating your app is not from trustworthy source.
Now in your device, Go to Settings, search for "Device Managament", select Your profile name and Trust.
Run your app again.

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.

"Communication with apple failed" when signing in Xcode 8

Just created fresh user account to test that issue.
In new account open Xcode 8.0
Start new project
In General settings pressed 'Add account' button (else it fails to run on a device)
When adding a team (I did not enroll into $99 Apple Developer Program) it shows these errors:
Communication with Apple failed The response data was not a valid plist.
No profiles for '...' were found Xcode couldn't find a provisioning profile matching '...'.
How to fix?
Maybe I’m doing it completely wrong. Is it possible to run the app on a device without enrolling into $99 program?
UPDATE:
Ok, I know now that I should be able to test my app on the device even without enrolling.
Moreover it was working fine before I’ve tested the app on few more devices (iPhones of my friends). After that it stop working on my iPhone
If you have a device and free developer account, that's enough to install and test your game...
Go to General Settings, and set your Team. I can see its already done.
To make sure you logged in to XCode, Go to Xcode-> Preferences->Accounts,
give your developer account login credentials
Connect device, it shows up after 3-5 seconds, select the device and run.
XCode prompts it can't find a valid provisioning profile with "FIX NOW" button, just press it and run again....
I create a new Certificate in iTunesConnect than click try again,It works.
I don't know why

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

Provisioning New Device for Development Xcode

I am a new iOS developer, and although I have been successful in provisioning a device for development in Xcode in the past, I just obtained a new device and am having an awful time getting Xcode to provision it and allow me to test applications on it.
When I connect the new device to Xcode, Xcode does recognize and identify the device correctly, however when I run the application I get the following error message: "A valid provisioning profile for this executable was not found."
According to the Apple documentation, I am supposed to first request a development certificate in Xcode using the following steps:
Choose Window > Organizer > Devices
Select Provisioning Profiles.
Click the Refresh button at the bottom of the window.
Enter your user name and password and click Log in.
After you sign in to your account, a prompt appears, asking whether Xcode should request your development certificate.
I have followed steps 1 - 4 repeatedly and each and every time Xcode crashes before I can get to step 5. I have tried completely closing xcode, detaching device, cleaning project, restarting computer, etc. Is there another way to request a development certificate outside of Xcode?
Ok so then the docs say I should provision the device (granted I assume this step is contingent upon the success of the previous step which I cannot achieve, but I tried it anyway) using the following steps:
Connect your device to your Mac.
Open the Devices organizer
select your iOS device.
Click the “Use for Development” button. The first time you add a device ID to your account, Xcode creates the iOS Team Provisioning Profile using the iOS Wildcard App ID, your development certificate, and the device ID. The iOS Team Provisioning Profile is also installed on your iOS device. If the device was used for development in the past, the “Use for Development” button may not appear. If this happens, click “Add to Portal” at the bottom of the screen instead.
So the "use for development" button does not appear (it appeared the first time I attempted this and hasn't since), so I clicked the "add to portal button". Every single time I do this, Xcode crashes.
I currently have the code signing identity set to iPhone Developer (my name). I have also tried setting it just to iPhone Developer and even Do Not Code Sign. I also went to the iOS dev center and added the device there (not sure if I needed to do that or not).
In any case, can anyone suggest anything I might be missing or any other approach?
While I was sleeping, Apple completely abolished the Portal and created a new and apparently largely broken interface. It's like a kind of evil April Fools joke. Anyway, if you go to https://developer.apple.com/account/ios/device/deviceList.action there's a great big sign telling you that you must "reset your device list before adding any new devices". That sounds like it covers exactly your case. Good luck.
I also went to the iOS dev center and added the device there (not sure if I needed to do that or not).
You need to add the device there.
Steps You need to follow after adding device:
Next re-download the mobile provisioning profile again.
Go to organizer and delete the old mobile provisioning profile you had.
Double click the new mobile provisioning profile you just downloaded and see that it appears on the organizer.
Connect your device and you should see your device's name instead of iOS device.
hope this helps.
If you are looking to bypass the 'Register a Device' portion of the Provisional Profile registration simply upload the 'sample .txt file' they provide you and upload it. You will then be allowed to click 'Next' to finish the registration so this way you do not have to enter a device UID.

Resources