In my project I am using a framework which contain simulator,dev and release version.How can I test the release sdk?What are the particulars that I have to check?
As far as I know ,I can change the scheme and create a release build.I want to know if it will automatically choose the release sdk or not?
Or do I have to create an archive and install as ipa file?If I can install the app via xcode do I have to remove the cable and launch the app manually?
If it helps someone :
If you have separate release sdk and dev sdk, you can select either of them as required by editing the scheme setting (Product->Scheme->edit scheme).
As you can see in the image below,You can set the build configuration separately for running,testing,profiling,archiving etc.
For testing the release sdk,you can select the build configuration to release and properly setting the framework search path,header search path etc in the buildsettings and run the code.
By changing the archive scheme setting to release,we can choose the dev/debug sdk to generate the ipa file for development deployment(Check out the following link for more details).You may have to use the development provisioning profile to do so.
Link 1
Link 2
Link 3
It's very straightforward with Xcode:
For me it builds dylib release version this way. If you just do build, Xcode builds debug version.
David
Related
I want to disable firebase analytics from collecting & sending events when I'm building, testing & debugging via an Xcode scheme argument, if able.
I'm aware you can edit the info.plist to disable (Firebase Docs) but would prefer a solution that doesn't require me to edit the .plist every time I'd like to switch between enabled and disabled.
Any suggestions?
You can configure two different plists into two different build targets, each with an associated scheme.
Details here.
Solution I came up with is very similar to Paul Beusterien's answer, but doesn't require a seperate scheme.
I made a copy of my current info.plist and named it info-debug.plist. I added the required key and value to disable firebase analytics.
FIREBASE_ANALYTICS_COLLECTION_ENABLED = 0
Then I selected my scheme Testing and under Packing -> Info.plist File -> Debug I set the value to info-debug.plist
Anytime I build and run my app in Xcode it will use info-debug.plist because my Build Configuration is set to the default: Debug. When I archive my app it will use info.plist as set by the Build Configuration for Release.
https://medium.com/geekculture/what-are-debug-and-release-modes-in-xcode-how-to-check-app-is-running-in-debug-mode-8dadad6a3428
Debug vs Release Mode
When you create a new project in Xcode, it defines two build
configurations, Debug and Release. By default, Debug configuration is
used during development whereas the Release configuration is used for
TestFlights or App Store. In other words, when you run the app on the
simulators or real devices by hitting the Run button(cmd + R), your
app is running with Debug configuration, aka Debug mode; when you
archive and upload a build to App Store Connect, app is running in
Release mode. However, this is just the default behavior. Technically,
you can run apps on simulators in any mode you want. It’s also true
for archiving(builds that you upload to the App Store Connect). To
change build configurations for development and archiving, you can go
to Product → Scheme → Edit Scheme(Command + <):
How to build scheme that I can use to build for TestFlight deployment that will have the app use a development URL to pull data from, and then have another build scheme for production that will use the production URL when the app runs. Any suggestions how this could be implemented?
Duplicate your existing scheme and choose another Build Configuration (not Release) under Archive. Probably you can use Debug there, if your debug configuration contains the necessary settings for compiling with the different URL (e. g. macro definitions). If not, you must create a new build configuration with this settings.
BTW.: I had the same need in my current app. Instead of creating different apps I've implemented a hidden settings dialog which allows changing the URL, and you can test your app with release code even its loaded from the app store.
I have a project with a framework target, but when I archive, the framework does not show up in organizer. I checked apple for documentation, but only found reference for static libraries.
Has anyone experienced this before?
Here are screenshots of my current scheme settings
Go into your framework and build.
cmd+b
You will find in your products YOUR_FRAMEWORK.framework
Right click on "YourLibrary.framework" -> Show in Finder
Now you can share/import your library.
Attention: Don't link/reference to this path because the framework is stored in Derived Data.
The only thing you should do is build the target,then show Products in finder ,you will see it.
The steps are documented by Apple here
Set up the project
To set up your project for creating an XCFramework, ensure your Xcode project has a scheme that builds only the framework target and its dependencies.
Configure these build settings on your target:
Set the Build Libraries for Distribution build setting to Yes. For Swift, this enables support for library evolution and generation of a module interface file.
Set the Skip Install build setting to No. If enabled, the built products aren‘t included in the archives.
Leave the Architectures build setting unset. The predefined value configures the target to build a universal binary for all the possible architectures the target platform uses.
Then you can use Archive to build your framework for Release.
Once built, the Organizer window will open.
You can then click on Distribute Content -> Build Products and export your framework.
Archive framework
Product -> Archive
//or
xcodebuild archive
[Archive location]
Xcode v12 does not have such problem and when you try to archive a framework Xcode prompt you to corresponding Archives window
Archive is an action from Scheme[About] which is competitor for Build action. Archive includes Build with additional logic. For example Archive is used for XCFramework[Example] which additionally can contains .dSYM and .BCSymbolMap files
For usual purposes you can just use Build action, it creates a corresponding .framework file in a Build location[About]
Ok, I am almost certain that this thing worked before but I am stuck now...
I have a workspace with multiple targets which I want to archive and submit to appstore simultaneously.
I have created a new scheme, I have all targets selected in there for Archive and I try to execute Archive in order to make all targets to IPAs
I always end up getting an Xcode Generic Archive. The only case I am getting an IPA is to select Skip Install = YES for all targets but one each time, which I suppose it actually means to build just one target so there is no meaning to multi target scheme.
Any clues about that? I checked the size of this Generic Archive and it looks like all apps combined in one file.
Indeed Apple confirmed that this is "impossible because archiving step in a scheme is designed to produce only one archive" and they asked me to build every target separately. I wonder if I can archive every scheme in a workspace automatically from command line to produce the desired result.
In order to create an IPA file using Xcode, we can use commands too. One can follow these steps:
1. Navigate to the App folder in Terminal
2. Run Cordova build command using "cordova build iOS" command
3. Open your iOS Project in Xcode.
4. Choose Product -> Clean. Then Archive.
More detailed screenshots are available here.
Background
I have an application I'm trying to archive and submit to the app store for approval. Part of the process requires the archive to be prepared and loaded using application loader. I used product-> archive and it prompts archive succeeded but it does not appear on the Organizer -> Archive tab.
Detail of Project build
1 app target, "AppName"
1 static library, cocos2d libraries (cocos2d v0.99.5-rc1)
Xcode Version 4.0.2
First steps
Setting "Skip Install" to "No":
Project
AppName target
cocos2d libraries
Setting skip install on the three allows me the archive to be built and show up(non-empty xcarchive) on the organizer. However, when I try to validate, it'll prompt:
"AppName" does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application.
I checked that the archive package contents include the cocos2d libraries within a directory "Products". According to some posts and the cocos2d forum, we're not supposed to submit that as part of the binary for approval.
Steps taken to the Zero KB .xcarchive
Since the static cocos2d libraries library should not to be included, I've changed the cocos2d libraries target to have skip install: "Yes". Now, if I archive the project it prompts build succeeded but it creates an empty .xcarchive file that cannot be seen on the organizer->archives tab.
I have the solution to my problem and if anyone else is facing the same problem here are the steps i took to fix the problem.
cocos2d library
-Set the skip install to YES for all configurations in your cocos2d library.
-Set the code signing identity to Don't code sign for all configurations. Static libraries are not code signed.
-Update the installation directory to /usr/local/lib.
app library
-Update the installation build products location to /tmp/$(PROJECT_NAME).dst
-Update the installation directory to $(LOCAL_APPS_DIR) (/Applications).
-Update the code signing identity section.
What worked for me was to delete the lines SKIP_INSTALL = YES; from the various *.pbxproj files.
Hat tip to this blog. (No instances of INSTALL_PATH found in our files.)