Cannot build iOS ad-hoc in Codename One - ios

While testing how Codename One iOS build works I found no way to make an ad-hoc build. I gave my Apple Developer credentials in CN1 to be used in the build process and CN1 correctly gave me the option to select the unique devices I had set up at the Apple Developer end. I got no errors and everything seemed to be ok.
However, after that process the only options I had for an iOS build were "debug build" and "Appstore build", the latter being grayed out. If I decide to move to CN1 I really need the ad-hoc option because the apps are definitely not going to the app store but installed through enterprise delivery channel(s).
So how can one do an ad-hoc release build? Or is it possible at all?

In Codename One Settings under the "iOS Signing" section you should see these options:

Related

Instruments stopped working on iPhone apps

I had used Instruments tool (an Xcode developer tool) to analyze iOS applications before with no issues. But now when I try to run it on any iOS app (for instance CNN), it is giving me following error.
"Target failed to run: Permission to debug com.cnn.iphone was denied. The app must be signed with a development identity (e.g. iOS Developer)."
Is there any work around? Is it not supported anymore in new version of Xcode? Few months ago, I was able to use it on all applications including CNN.
Just edit a Profile section in target scheme. Switch Build Configuration to Debug.
Assuming that you are using the Release configuration to run in Instruments (as recommended), you need to review the code signing and make sure that Release is configured to use your Developer identity (instead of Distribution, for example).
First click your target
Choose Edit Scheme...
Select Profile and make sure Build Configuration is what
Here, my Build Configuration of Profile section is AdHoc. Don't change this selection to Debug, cause in Debug mode, it won't be optimized by compiler like AdHoc or Release.
Then come to Build Settings, change the Certificate and Provisioning Profile.
From this picture
To this picture
It's done!
The application (one wants to run Instruments libraries on) has to be in running state and then select from the 'Running Applications' category and not from the 'Installed Apps' category and that should work.

Run release build of iOS app on development device

When I build my iPad app for running on my development iPad, it only builds the debug version. I need to see how fast the real release version is; how do I do this? I'm used to Visual Studio's Debug/Release builds, so this Run/Test/Profile/Analyze/Archive stuff isa bit confusing. I see Schemes are related to this but isn't there a simple switch "I want to test Debug/Release version of my app on my device"?
You want to do a release build using an ad-hoc provisioning profile, which will allow you to install it on your device and any others you have specified.
Test flight app is free and can help with this process as well.
In your scheme settings, you can select to build for debug or release. Make sure you have set up code signing correctly. Xcode 5 can help with that.
You can create a new Build Configuration in the Project View under the Xcode Project. Make it a duplicate of Distribution
Then just choose Edit Schemes and choose the new scheme and run on your device. Make sure you the certificates selected in your Build Settings. However you don't get full Debugging capabilities when running a AdHoc/ Distribution build.
This took me a really long time, but I got it working. I usually use automatic signing and it works great. I switched to using FastLane in order to speed up the test flight distribution process and it required that I switch to manual signing. I had to change my release signing certificate to iOS Distribution.
I then had a bug that was only reproducible in release mode, so I needed to run the app on my device in release mode, but it was a pain to keep re-uploading to test flight.
I tried changing my build system to legacy, but that didn't work. I read up on profiles and certificates and I realized that I need to use iOS development certificates to run on device directly (which is what I was doing in debug mode). However, I needed to use iOS distribution certificates to distribute the app. Automatic signing had been taking care of this for me.
I ended up just turning on automatic signing briefly to test my app and then turned it back off and used git to revert the status of the workspace.
TLDR: turn on automatic signing and then turn it back off when done testing

What sort of provisioning profile should I use for Hudson building my iOS app?

I'm building an iPhone app and I am tasked with automating the build to integrate with our Hudson-based build of our back-end Java components. I see Apple docs mentioning 'build bots,' but I haven't seen what Apple recommends for creating an automated build/CI system for iOS apps.
And I'm not sure I understand the differences among development and distribution and ad-hoc profiles, so I hope experienced members won't mind helping me figure out which type to request and install.
My Hudson is slaving a build Macintosh using a non-privileged user account.
I would like to take successful builds and enable my co-workers and other interested parties to install them on their own iDevices.
What's the right type of profile to use for xcodebuild to sign the app and make it installable?
Thanks in advance!
Andrew Wolfe
you want to use an AdHoc profile if you're wanting to distribute the app to people who aren't using xcode. remember that you'll have to add the device UDIDs of each person you want to be able to run the app to the profile.
in your project (in xcode), create a separate AdHoc target so you can specify the profile. then when you set things up on hudson, you specify the AdHoc target on the build command line.
i highly recommend looking at https://testflightapp.com/. it's a great service and a god send when you're dealing with sending out adhoc builds to people. and it's free!

iOS: When to Use Which Code Signing Identity in The Build Configuration?

I am never very clear regarding to which Code Signing Identity I should use in the Build Configuration concerning which scenario, and would love if someone can explain it in the most simple way.
This is what I know:
I create in the Provisioning Portal and implement in my apps both a Development Profile and a Distribution Profile.
Then I assign the Project >> Build Settings >> Code Signing according to the different profiles:
Here is the first question: What is the difference between Release and Distribution? Which one should be connected to the Developer profile and which one should be connected to the Distribution profile?
Now, if I understand correctly, I'm supposed to set the "Scheme" before I run the app:
There are 5 different steps in which I'm required to define the Build Configuration by selecting one of the Code Signing Identity:
Here is the BIG QUESTION... In which scenario I should select which Code Signing Identity?
I always run the app on the same 2 devices: my iPhone and my iPad; both are defined in the Provisioning Portal and set into the profiles.
I only want to make sure I run it OK for testing on Simulator and on Device and later on to build the app for uploading to App Store.
Any assistance / direction will be much appreciated.
By default, the standard Apple templates only create Debug and Release configurations. Distribution seems to be redundant with Release.
Debug is the configuration used when you are actually working on the code, and Release is used when you archive it for other people to install. You should use your developer profile for Debug and your distribution profile for Release.
You should also probably use your distribution profile for distribution, but you should really check with whoever created that configuration to see what its purpose is first.

How do I create a release build in Xcode?

Why is it that when I build an application, Xcode creates a debug build? I want to create a release build. How can I do this?
Product / Scheme / Edit Scheme..
And from the menu that comes up, select Release under "Build Configuration".
Xcode 11
I found this question because I had already finished debugging my app and I wanted to make a release build for the app store. I always forget which menu item to use, though. This answer is a reminder to me and others next time.
Choose the Generic iOS Device from the active scheme menu.
Then go to Product > Archive.
You may have to wait a little while for Xcode to finish archiving your project. After that you will be shown a dialog with your archived project. You can select Distribute app... and follow the prompts.
More Help
This answer is for those who are already all signed up with a developer account and just need to get the archive from Xcode to iTunes Connect. If you need more help signing up for a developer account and getting an app to the app store, read the following links.
How to Submit An App to Apple: From No Account to App Store – Part 1
How to Submit An App to Apple: From No Account to App Store – Part 2
App Distribution Guide (Apple Docs)
Submitting Your App to the Store (Apple Docs)
It is done over building an Archive version.
First connect a iOS device to your Mac. Then select that device as target in Xcode.
Now click on the tab "Product" and click on "Archive"
Leaving the original answer below, but this has not been the recommended method to create a "release" binary for distribution outside of Xcode in a long time — for that you want to Archive: see answers above.
If you are looking to debug/test a Release build in Xcode, this approach is still relevant.
To create a release build, you have to edit your current scheme (⌘<) and highlight "Run [name of application]. On the right, select "Build Configuration" and choose "Release". Build as usual.
If any one needs to go through how to make Adhoc build, here are quick steps
Product > Archive
then
Export > Save for Ad Hoc Deployment ....
See quick video https://jumpshare.com/v/rHLJII2npwyHCgGCabQA
Follow these steps:-
Go to product option
select Scheme option
Edit Scheme option
change Debug to Release
Make sure Through this you can run build in your physical device if you are disconnected to System..
but if you will run the same code o n simulator then you will face some error then that time you need to change the scheme option Release to Debug
Here is my 'more detailed' list of steps for creating a release build > (Working on a team and a project that has many schemes and environments)
checkout a new branch like releases/x.x.x that contains all changes. (x.x.x is the version) (Its more about your team conventions)
Check to make sure your app bundleIdentifier is correct (might differ for each environment)
Team/account/licence: log into correct account that has provisioning profiles. then under signing and capabilities make sure your Team is correctly selected and has all certificates needed
Upgrade the version in project settings to x.x.x
Make sure the scheme you selected is correct
Make sure the URLs of API calls are pointing to your release environment
Its better to select 'Any iOS device' instead of a simulator or actual device
Commit any changes locally if you have any (this step is very important)
Validate to make sure all is good
Create an archive
Distribute your app for AppStore Connect
I use an apple proxy named 'transporter' that is pretty easy for uploading iPA to Appstore
Happy releasing!

Resources