ARKit and Xcode 9 requiring a provisioning profile - deployment

I'm brand new to iOS development, Xcode, Swift, etc. I just upgraded to Mac 10.12.6 Sierra and downloaded the new Xcode 9. I just want to deploy a simple ARKit app to my iPhone for good hobby fun. I'm not a professional iOS developer writing some huge app for profit (TL;DR: I have no interest in spending $99 USD/yr for a developer license just so I can make fun little apps for my own private use!).
So I open Xcode 9 and create a new Augmented Reality project:
I then fill out project properties:
So it starts complaining that my project requires a development team:
According to this answer, the solution is to uncheck the "Automatically manage signing" checkbox. So I do that, but now I see a new set of errors:
Searching for "xcode requires a provisioning profile" doesn't seem to kick up any helpful results. Any ideas what the fix is here?
Update
Per #rickster's suggestion I re-checked the "Automatically manage signing" checkbox, which then allowed me to select a Team. I selected my logged in account ("Personal Team"), and after a few seconds a new error has appeared:
"Failed to create provisioning profile."
Any idea as to why this is failing and what the fix is?

You just need to plug your phone into your computer and keep the phone from locking. Then go back to the main General tab in your project and Xcode should automatically create the provisioning profile for you. HTH!

There's nothing specific to ARKit here — building and running any app on an actual device requires signing.
However, if you have an Apple ID (like you use for iCloud, iTunes purchases, Apple Music membership, etc) you can develop on your own device — just sign into that account in Xcode > Preferences > Accounts. You can't deploy to the App Store or even ad hoc distribution that way, but it's good for getting started. Once you're further along you can join a developer program for deployment and resources.

just add quotes between the name bundle identifier!
ex:
"io.ionic.starter"
or
-io.ionic.starter-
Good work for you !

Related

Preparing Ad Hoc Distribution for my app

I have been reading several tutorials and watching some iTube videos to see how I best prepare my app for Ad Hoc distribution. However the information I got is not really consistent, it goes from the 5 step explanation from the Developer Center of Apple to a almost 3 minutes video, where I would have to set some Code Signing options in XCode, create and zip the Archive etc.
My questions:
1.
Is there a tutorial available, which explains everything required, but not too much? I somehow feel, for instance, that code signing is not really required.
2.
After I tried to install the app using iTunes, the synch claimed that it was not able to install it. Is there some log available in iTunes, so I can check for further error details?
3.
How about switching from Ad Hoc distribution mode to normal developer mode? After I followed the steps from the video and prepared my app for Ad Hoc distribution, I was not able to install it on my device anymore, I got the error
Build target Abiliator
Check dependencies
[BEROR]CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 5.0'
This is the video tutorial on iTube I followed: Demo of iPhone app Ad Hoc distribution
Thanks for your feedback and have a great weekend.
OK, looked up the Error
" the following job tried to hijack the service..." and saw that a reboot of the iPhone may solve the issue... and guess what, I was chasing a phantom all day long.....
It works perfectly.
So last hint for anyone, having a similar issue, after installing an app via Ad Hoc the first time: Reboot iPhone, otherwise the app may crash.
Cheers and now good nite :-)
PS: Just to round this thread up here the steps I did at the end (as mentioned, I am using XCode 4.2.1) :
Added my device on the Provisioning Portal (this had been done long time ago, however it is an important step, as the beta testers device IDs also need to be registered here before you re-create and download the distribution profile)
Created and downloaded an iOS Distribution Certificate in the Provisioning Portal
Imported the certificate in my Keychain
Created a Ad Hoc Provisioning File in the Provisioning Portal
Downloaded that profile
Double clicked the profile, which added it to the XCode Organizer Provisioning Profile Section)
Added the options Any SDK and Any iOS SDK in for Ad Hoc Distribution Code Signing Identity in the Code Signing section of my project AND my target and set the values with my Ad Hoc Provisioning File I just created and imported
Made sure the option in my app .plist file "Application requires iPhone environment" was set to true
Ran a clean (Product / Clean) and then a build only (Product Build)
Made sure the app was not installed on my iPhone (as I was testing before via XCode)
Copied the target (group Products via Show in Finder) to iTunes via Drag and Drop (I dropped it into the Media section)
Copied the Ad Hoc Provisioning File into iTunes via Drag and Drop (also to the Media section)
Made sure the app was checked for the synch, synched iTunes with the iPhone
Lastly rebooted my iPhone! However, I am pretty sure, that this might occur on the Developers device only. I assume that the reason for that was a process, still remaining on the iPhone, from my last test via XCode.
I did not use an entitlements file. I have actually to find out, what that file is really for, I have read that it might be required only, if using iCloud. And XCode 4.2 developers, there is nothing like File / New / Entitlement Template anymore in XCode. The file is created as soon as you check the option Entitlements and give the file your desired name in the Summary tab of your target.
You may also want to download the iPhone Configuration Utility from apple
I will also recommend this to my beta testers, as it allows you to see the console log of the iPhone, which of course might be very helpful in case of errors.
Hope this summary helps others, setting up their app for the first Ad Hoc distribution.
Cheers, René
code signing is simple.
first you create a mobileprovisioning profile for your apps bundle identifier also add the devices you want to built the app for. for adhoc build do it in distibution tab. download it, double click add it to keychain.
now you tak your app in xcode.select coreect profile(code signing). set command line build to distribution, oh i forgot create a new file(entitlements.plist) set debug inside it to false, add its relative path in the target, just above codesigning specified. now select the iosdevice on top left(where you select the simulator) press command+b to build the app. the app would be in the products folder(at the bottom) locate it in finder drag it to itunes, may be provisioning profile too, and sync it. done.
Go to https://developer.apple.com/devcenter/ios/index.action and login. You can find 'iOS provisioning portal'. And after going there, choose 'Distribution' section. Select "HOW TO", you can find necessary steps there.

Deploy an iphone app from xcode to iphone

I am doing a school project and I am required to deploy an iphone app to my phone. I have some really noob questions to ask. I have tried to read some solutions from this website but I dont understand! like from these questions: iPhone app minus app store and How can I deploy an iphone application from xcode to real iPhone device.
Can anyone here give me an easier way to understand please?
Easy:
Sign up for an iOS Developer account. This includes signing up for an Apple ID, enrolling as an Apple developer, then opting that dev account into the Developer Program. That link walks you through the process.
Hook up your device to your machine and look at it in the Xcode organizer (Window > Organizer).
Tell Xcode your want to use it for development.
I believe Xcode will now help you out more than it used to. If it doesn't, then Apple has step-by-step instructions. In short, you need to:
Use Keychain Access to generate a CSR (certificate signing request)
Submit that to Apple via the dev portal
Download the resulting development signing certificate and install it along with Apple's intermediate certificate in your keychain by double-clicking on the files.
You then need to create a provisioning profile.
Add your device ID to it.
Download it and stick it on your device, e.g., by dragging it to your device in iTunes.
Then, you can build and run your app on the device. It's a pain to explain, but pretty easy to feel your way through once you get started.
My fuller answer with pictures is available here.
With Xcode 7 for an iOS 9 target device there is now free provisioning. You don't have to sign up for the Apple Developer Program in order to test an app on a real device.
Summary from the Apple docs:
If you don’t join the Apple Developer Program, you can still build and
run your app on your devices using free provisioning....
In Xcode, add your Apple ID to Accounts preferences
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.
Click the Run button.
When you run your app on a device, you will also have to trust the developer first. On your device go to Settings > General > Profile > developer account name > Trust.
Related articles:
Xcode 7 allows anyone to download, build and ‘sideload’ iOS apps for free
iOS Untrusted Developer error when testing app
iOS9 Untrusted Enterprise Developer with no option to trust
This SO question here gives detailed steps of how to do what Jeremy suggests.
How can I deploy an iPhone application from Xcode to a real iPhone device?
Take note that /Developer was moved to /Applications/Xcode.app/Contents/Developer in Xcode 4.3.
And, this SO question says what to do if you get an [sed: RE error : Illegal byte sequence].
RE error: illegal byte sequence on Mac OS X
But in XCode-5.1/MacOS-10.9, this still didn't work - I lost the devices tab in XCode-Organizer after editing the plist file!

I can actually install a few apps without provisioning

Yesterday I was playing with the three20 library. I hit the command+enter to build and run the app on my simulator, to my surprise it installed the app on my device iPod Touch 4th Gen. I really dont know how that happened, I tried doing it with few of my other project and unfortunately it did not work.
Today, I downloaded the quick contacts sample code from Apple's developer site and the same thing happened, I could install the app on my device without any provisioning. I see that for the above two projects (three20 and quick contacts) my device is listed in the active executables.
But for other projects my device isn't listed. I tried running the above two apps on other devices which failed with a message - "No provisioned iOS device found". My device isn't jailbroken, its a brand new one I bought a few days ago.
Am I missing something, because being able to install apps without going thru Apple's portal is a huge bonus and I would like to achieve the same functionality for my other apps too.
I tried attaching screenshots, but looks like I atleast need 10 points to do so and I'm new here. Sorry.
Have a look at the XCode Organizer; As of a few versions ago it now manages a 'Team Provisioning Profile' that works off any bundle identifier and any of your devices if they've been added to your developer account. This is not a special provisioning profile, just an automatic one it sets up for you if you tell it your iTunes Connect details.
WIth this, anything you build and run should be able to use that provisioning profile to run code on your devices.

Putting my iPhone app on my phone to test?

How do I take my working iPhone app and put it on my phone to test with? I dont seem to see how and my googleing doesn't turn up what I think I am looking for...
I am a registered developer and have paid my $99 already.
Would anyone know?
Note: I have already placed the same answer somewhere else for the same question.
There are some steps you need to follow to test your app on your personal iPhone. Below you can find all the steps:
Create a MAC certificate at first step.
Upload that certificate to developer account.
Open developer account at https://developer.apple.com
You can now find an option for device id in your developer account on left side.
Register your iPhone device.
It is time to create your unique identifier on developer account, download your certificate and install it on XCode organize
Now open your project and embed your unique identifier in your project.
These steps can be beneficial for all software testing gusy involved in mobile application testing.
You need to register as an Apple developer. This will cost you $99/year.
That is the only way that I know of apart from Jailbreaking your phone.
Open Xcode Organizer window and provision your device for development. This will register the device UID with Apple and install the development provisioning profile on it. If you don't have provisioning profile, Xcode will create one automatically.
Once this is done, you need to set your build to use your DEV cert to aign your app. Then you can switch the build configuration from Simulator to Device and build and run on your phone.
Did you just complie your project or you complied and Run? If you Build your project and you have no errors it means everything it's ok. The next step is to Build and Run your project or just Run your project.
If you Run your project and nothing happens it means that you have something worn in your target configuration. Did you change anything there? In the Project Tab in your XCode go to Edit Active Target Settings and check that your Base SDK and Target SDK match your iDevice SDK.
IF you don't find out what the problem is, contact me, i could help you in anything you need.

Code Sign Error When Building iPhone Application

I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:
Code Sign error: a valid provisioning profile matching the application’s identifier could not be found
I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?
At first it seems a complex process, but it's pretty straightforward when you've been through it a few times.
In a nutshell the process is this:
(I'm assuming you've set up your iPhone/iPod touch as a test device)
Via the iPhone Developer Portal
Create an App ID
(give your application a name, this is just for reference on the website and nothing to do with your own build of your application)
enter a string to identify it, like com.yourcompany.appname
(this is important and should be the same as in your .plist file inside Xcode)
Click and Save this
Go to Provisioning
There are 2 provisioning profiles you'll need
a) development - so you can install your application on a test device (i.e. your iPhone / iPod touch)
b) distribution - if you want to sell the application via the App Store
You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save
In a few moments (usually, though it can be longer) the certificate is available for download. Download this to your Mac and drop it onto the Xcode icon. Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device.
Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles, and add modify your certificates privilege.
In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. Usually for debug I sign with the development certificate. Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. (You won't be able to load the app onto your phone with the distribution profile selected)
Make sure you select the target device as Device and not Simulator when building for the App Store!
Hope that helps, it's from memory so apologies if I've skipped some small steps.
xcode top left corner make sure you're running as "similator" "iphone"
Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution?
If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone. Apple has provided a great series of video tutorials.
Just make sure you install the certificates or the profile won't be selectable in the project configuration. When you download the certificates double-click on them to install.
Possibly more use for others seeing this issue on a previously configured dev environment.
This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh.
This was the winner for me when I had this issue.
As of July 2012, you can go here:
https://developer.apple.com/ios/manage/overview/index.action
Then launch the "Development Provisioning Assistant." It walks through all the steps outlined by FiddleMeRagged.
You can use this process to create a Wildcard ID, if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away.