Crashlytics Developer Needs to Upload a Build That Supports Your Devices Architecture Armv7s

App thinning, Bitcode, Slicing: tutorial (iOS app)

How it works?

Apple tree has released several models of the iPhones/iPads/Apple Tvs, having different CPU architectures, screen resolutions and the screen sizes. Here we will mainly talk about iPhone. Though the aforementioned process will be applicable to iPad and Apple tree Tv as well.

Architectures similar armv6 (older iPhones), armv7 (iPhone four, 4S), armv7s (iPhone 5, 5c), arm64(iPhone 5S and later). The different resolution requires dissimilar image versions like @2x (iPhone 4, 4s, v, half dozen, 6s, 7, 7s, 8, XF), @3x (Plus size iPhones, X, Xs, XS Max).

Apps have to back up all of the architectures and the screens when released to the market place. A Universal binary must exist generated which supports all of the variants. No affair which device you install the app on, the universal binary will exist downloaded to your device, definitely, the size of the binary will be big. One can clearly see that the binary is not optimized. A larger size causes more Data consumption, larger size on disk and might restrict "over the air" download.

Apple tree came up with an optimization (chosen App thinning) and with this, App Shop will tailor the binary for all the possible device configurations and a thin binary will be downloaded on a detail iPhone.

How it works:

Slicing: Here is what Apple document says almost it.

Slicing is the procedure of creating and delivering variants of the app bundle for different target devices. A variant contains only the executable architecture and resource that are needed for the target device. You continue to develop and upload full versions of your app to App Store Connect. The App Store will create and deliver unlike variants based on the devices your app supports. This works only on iOS ix and afterward, the older volition withal be getting the Universal binary.

Bitcode:

Bitcode is an intermediate representation of a compiled program, something similar to Bytecode in JAVA. When you archive an awarding with bitcode enabled, the compiler produces binaries containing bitcode rather than machine code. Once the binary has been uploaded to the App Shop, the bitcode is compiled down to machine lawmaking. The App Store may compile the bitcode again in the future, to take advantage of future compiler improvements without whatever activeness on your part.

Confused? Bitcode, slicing and app thinning are little confusing terms. Let me explain them a flake. App thinning is the whole process of delivering a tailored binary to the devices. It includes App Store + Operating System, both together works towards enabling the download and utilize the thin binaries. It manages future updates too. Slicing is performed by the App Shop (TestFlight and Xcode can also practise that for testing). The App Store receives a bitcode enabled fatty binary from the developer and slices it into modest binaries. The number of binaries volition be equal to the number of device variations supported by the app. A thin binary is generated for a particular architecture and contains but the required avails. The binary volition contain either @2x or @3x images based on the iOS device. Bitcode is a pre-requisite of slicing. You enable bitcode in Xcode. Unless until y'all enable the bitcode, Xcode won't generate a bitcode binary and and then the app shop won't be able to recompile it to generate smaller binaries and the slicing won't happen.

What exercise we demand to do:

  1. Use the Asset Catalog to the store avails like images. If y'all are supporting iPhone 4 and in a higher place and not supporting iPad ii or earlier, you lot don't need the 1x images at all.

ii. Enable Bitcode for the project. You accept to enable it for all the 3rd party frameworks. If the electric current frameworks are not bitcode enabled, you lot have to download their bitcode enabled version.

Errors:

You lot might become the following error for a framework integrated in your project like

bitcode package could not be generated because '/ the location of the SDK' was congenital without full bitcode.

There are two steps to enable a bitcode for 3rd party projects

2.ane : Plough On the ENABLE_BITCODE flag into the Project Build Settings.

2.2: Add -fembed-bitcode as a compiler flag under Other C Flags into the Project Build Settings.

See Enable Bitcode and Other C Flags settings

If you go the following error, the reason could exist a framework is bitcode compiled using the dissimilar version of Xcode than the one you are using for compiling at present. In my case, one of my frameworks was compiled using Xcode ix.4.1 while I was using Xcode 9.2

three. On-demand resources.

On-demand resources are resources — such as images and sounds — that you tin tag with keywords and request in groups, past tag. The App Shop hosts the resources on Apple servers and manages the downloads for y'all. The App Store also slices on-demand resources, further optimizing variants of the app.

Getting app size report:

One time the lawmaking changes are done, nosotros have to generate the report. In that location are the following ways of seeing the study before y'all go live.

  1. Xcode report: Consign the annal, select "All Compatible device variants" from App Thinning dropdown and bank check the "Rebuild from Bitcode" checkbox.

Information technology will have some time and generate all the different ipa files for the supported iPhones. It will also generate an App Size report.

2. Testflight report: Once yous upload the bitcode enabled binary to the testflight, the test flight shows the summary similar beneath once information technology'due south reviewed and bachelor for testing. You can tap on a link "App Store File Sizes" and get the report. Information technology will show a written report detailing the sizes for all the possible iOS devices.

NOTE: The app slicing process takes place at the App Store. Since the Enterprise apps are not uploaded to the app store, you might choose to keep the bitcode disabled for them. However, for Enterprise builds, Xcode can generate sliced binaries on your mac itself. In that example, the users have to install the appropriate binary by themselves.

The dSYMs:

Equally we saw earlier, that the Bitcode enabled binary generated past Xcode contains bitcode and not the machine code. App Store recompiles the binary from bitcode to machine code. So the bodily dSYMs will exist generated at this indicate by App Shop. Your Xcode does have dSYMs but that is for the bitcode binary. They tin can't be used to de-symbolicate the crash reports for the crashes faced past existent customers.

So, once your app is reviewed and fix to exist released, yous have to download the dSYMs and continue it somewhere for records (Yous might want to upload it to Crashlytics/Cloth/Firebase).

Testflight provides a link to download the dSYMs as shown in the epitome to a higher place "Download dSYM".

Downloading the dSYM files from the iTunes Connect website

  1. Open the App Details page.
  2. Click Activity.
  3. From the listing of All Builds, select a version.
  4. Click the Download dSYM link.

This is a very powerful feature which every app which is larger in size should prefer. Electric current, over the air download limit for iOS apps, is 150 MB that means if the size of the app is larger than this App Shop won't permit the download over LTE/4G. While the device disk size is not a big business organization for iPhone users these days, reducing the size will still help in faster app updates.

In this tutorial, mostly I have shared what I accept to do to support app thinning in an older projection.

Cheers for reading this. Allow me know your feedback.

Happy coding!

wadeevencline.blogspot.com

Source: https://ankur-s20.medium.com/implementing-app-thinning-in-your-project-step-by-step-tutorial-ios-app-b3cfd139896d

0 Response to "Crashlytics Developer Needs to Upload a Build That Supports Your Devices Architecture Armv7s"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel