Why does xcode archive succeed but create an empty .xcarchive file? - ios

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.)

Related

How to download and install iXGuard for iOS apps?

There is no any document for working with iXGuard.
How to download?
How to install?
How to working with it?
I have searched in website but not find any guid.
https://www.guardsquare.com/en/blog/ixguard-30-released
You need to request your quotation first before start using iXGuard, after you enroll they will give you access to guardsquare dashboard, And you can download iXGuard package (Documentation include on package)
Here is a small post be me - Getting Started with iXGuard — an obfuscation & app shrinking tool.
In this Tutorial, you’ll learn how to implement iXGuard in iOS project and how to strip down your app size by making use of iXGuard — an app shrinking and obfuscation tool. This is a step by step process tutorial for installing iXGuard. Let me know of any issues. I have briefly explained the process below.
It is not possible to write or explain the whole tutorial with images in the stackoveflow answer so a link is provided.
Installing iXGuard
Install iXGuard for your version of Xcode using the standard procedure of installing a package file.
Create an IPA using Xcode
1) Create a file for distribution with Product -> Archive in Xcode
2) Select the archive created in Organizer and select Distribute App.
3) Select iOS App Store then Next
4) Select Export and click Next.
5) Include bitcode for iOS content and Upload your app’s symbols to receive symbolicated reports from Apple After checking the items click Next
6) After setting the certificate related settings, export and save
Create ixguard.yml
a. The file may be different for each app. For details, please refer to the Configuration page of iXGuard.
b. From the folder where the exported ipa file is located to the terminal
ixguard.yml -o [Obfuscated IPA file name] [Generated IPA file name]
When you input the command, ixguard.yml default file is created.
Sample — ixguard.yml (This may vary from Project to Project
Apply iXGuard From the folder where the exported ipa file is located to the terminal ixguard. Please enter the following command in the terminal. config ixguard.yml -o [After obfuscation IPA] [File name] [Generated IPA file name] to apply iXGuard.
If there are no error’s in the operation, an obfuscated ipa file is created.
In the case of [warning] of the log in the terminal, the solution for each case is the same as that of the iXGuard manual
On the Troubleshooting -> Runtime Issues page. — Note: Appearance
Note: Result screen
Test your app
Test the function of the app by using methods such as TestFlight on the actual device.
In particular, tokens, authentication keys, etc. are required for logic-oriented testing.
Obfuscation verification
This part has been verified using the MachOView tool.
1) Perform step 2 to create an ipa file. Include bitcode for iOS content check - Release and create two obsolete ipa and two ipa files that are not obfuscated.
2) Change the extension of the corresponding ipa file to zip and unzip it.
3) There is a Payload folder in the unpacked folder, and check the application file with the app name in it.
4) Right-click on the application and select View Package.
5) Copy the executable file with the name of the app in the package and extract it to an arbitrary directory.
6) Open the executable extracted before obfuscation and executable extracted after obfuscation with MachOView app,
Check the name of the debris and confirm that obfuscation is applied.
Image for reference in tutorial. (Above: prior to obfuscation, below: after obfuscation)
Finally , deploy the app in the App Store –
Xcode -> Open Developer Tool -> Application Loader.
Application Loader is not available now. You can use Transporter app which is available in Mac app store.

How to protect iOS Application from attackers using iXGuard

Code obfuscation Process is there in Android Using DexGuard like that they are newly introduce iXGuard. Can any one know how to implement iXGuard in iOS project.
To protect an application with iXGuard you'll need to run ixguard-install from the terminal in the root of your Xcode project. It will update the project file and add a new iXGuard build phase, which calls the iXGuard binary as part of building your app. You'll also need to create a ixguard.yml configuration file to enable the different features.
For more information you can check the manual which is located (after installation) in /Library/iXGuard/documentation/
(I'm one of the developers of iXGuard)
Here is a small post be me - Getting Started with iXGuard — an obfuscation & app shrinking tool.
In this Tutorial, you’ll learn how to implement iXGuard in iOS project and how to strip down your app size by making use of iXGuard — an app shrinking and obfuscation tool.
This is a step by step process tutorial for installing iXGuard. Let me know of any issues. I have briefly explained the process below.
It is not possible to write or explain the whole tutorial with images in the stackoveflow answer so a link is provided.
Installing iXGuard
Install iXGuard for your version of Xcode using the standard procedure of installing a package file.
Create an IPA (based on Xcode 10.1)
Create a file for distribution with Product -> Archive in Xcode
2) Select the archive created in Organizer and select Distribute App.
3) Select iOS App Store then Next
4) Select Export and click Next.
5) Include bitcode for iOS content and Upload your app’s symbols to receive symbolicated reports from Apple After checking the items click Next
6) After setting the certificate related settings, export and save
Create ixguard.yml
a. The file may be different for each app. For details, please refer to the Configuration page of iXGuard.
b. From the folder where the exported ipa file is located to the terminal
ixguard.yml -o [Obfuscated IPA file name] [Generated IPA file name]
When you input the command, ixguard.yml default file is created.
Sample — ixguard.yml (This may vary from Project to Project
Apply iXGuard
From the folder where the exported ipa file is located to the terminal ixguard. Please enter the following command in the terminal.
config ixguard.yml -o [After obfuscation IPA] [File name] [Generated IPA file name] to apply iXGuard.
If there are no error’s in the operation, an obfuscated ipa file is created.
In the case of [warning] of the log in the terminal, the solution for each case is the same as that of the iXGuard manual
On the Troubleshooting -> Runtime Issues page. — Note: Appearance
Note: Result screen
Test your app
Test the function of the app by using methods such as TestFlight on the actual device.
In particular, tokens, authentication keys, etc. are required for logic-oriented testing.
Obfuscation verification
This part has been verified using the MachOView tool.
1) Perform step 2 to create an ipa file. Include bitcode for iOS content check
- Release and create two obsolete ipa and two ipa files that are not obfuscated.
2) Change the extension of the corresponding ipa file to zip and unzip it.
3) There is a Payload folder in the unpacked folder, and check the application file with the app name in it.
4) Right-click on the application and select View Package.
5) Copy the executable file with the name of the app in the package and extract it to an arbitrary directory.
6) Open the executable extracted before obfuscation and executable extracted after obfuscation with MachOView app,
Check the name of the debris and confirm that obfuscation is applied.
Image for reference in tutorial. (Above: prior to obfuscation, below: after obfuscation)
Finally , deploy the app in the App Store –
Xcode -> Open Developer Tool -> Application Loader.

How to archive/export Framework in Xcode?

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]

Xcode Scheme with multiple targets creates Generic Xcode Archive

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.

Why are static library symbols not included in dSYM during archive?

We have a pretty major application suite for a client with a couple application targets utilizing several static libraries that we made in house. All targets are contained in one XCode project file.
For some reason when archiving an application the dSYM file does not contain any debug symbols for static libraries. The result is when trying to symbolicate crash logs from field agents we cannot see what is going on inside those static libraries.
I attempted to create a new simple XCode project with one application target and one static library. Even then the debug symbols were missing. I fiddled with the build settings according to this https://github.com/TheRealKerni/QuincyKit/issues/91 without luck.
If I build FOR archiving the debug symbols are included. I ran dwarfdump on the resulting dSYM file and was able to see the symbols for the static libraries implementation files. However when I then attempt to archive the project the symbols are excluded.
Am I missing something? XCode version 4.4.1
I m using XCode 5.1.1 and was having the same problem.
The fix was to set "Strip Linked Product" setting under "Deployment" section to "No" for each dependent library project. For more detail, please see my post at
can i debug ios app installed from ipa archive
This appears to be fixed in a later version of XCode, currently using 4.6 and the problem went away.
If you are stuck using an older version then do the following:
Product > Build For > Archiving
Product > Archive
Open the built product from derived data, you can do this by right clicking on the Youapp.app file in Products group and selecting show in finder. Ensure you are in the Release-xxx folder. Copy the dSYM file generated there and replace the one produced by the archive process. To find where archived files are go to Organizer, Archives tab, right click on an item and show in finder.
Hope this helps.
By default, archive uses release build, which already stripe debug symbols. you can change archive build option to 'not stripe'.

Resources