Combine two Xcode targets into one distributable app - ios

I created two targets in my Xcode project. One for an iOS app, and the other for the iPadOS companion. Now I'd like to distribute them under one name and App Store link, but I can't submit different builds for iOS and iPadOS through App Store Connect.
I can't combine the targets into one, because I have some UI libraries that won't work on iPadOS and/or won't work on iOS. I'm also planning on making the iPadOS target into a Mac-Catalyst app, so I'd like to keep the targets separate for that as well.
Is there a way to archive these two targets together so App Store Connect sees both apps in the one upload? Or do I need to distribute the iOS and iPadOS apps under different bundle IDs.

You certainly could distribute them under different bundle IDs. It's very easy to make two targets share code, as you are probably already doing.
However, it is more usual to have just one app, a so-called "universal" app, that runs on both iPhone and iPad (and so is built using just one app target). It is quite normal for these to have some functionality that differs by device type; resources such as images or nibs can automatically load different versions depending on whether we're running on an iPhone or an iPad, and the traitCollection has a userInterfaceIdiom property that lets your code decide in real time what to do depending on that same distinction.
So just go ahead and load all your "UI libraries" for both device types, and just don't call into one of them if it isn't supported by the current circumstances in which the app finds itself running.

Related

UI Testing of iOS 3rd Party applications - No Source Code

I'm working in the Aviation industry and part of my job is managing electronic flight bags (EFB). We rely on 3rd party applications such as Ozrunways/Jepp FDPro and therefore we don't have the source code or .ipa files to create UI tests through XCode.
There have been issues where updates to apps will get released with small bugs and we only find out via user reporting. I really don't wanna go down the road of creating a manual testing regime whereby each app is tested by humans pressing buttons on the device to ensure the UI/functionalities are the same.
Is there any way to automate this through the simulator or the device?
Note: I went down the appium path originally but realized without the .ipa file it's almost impossible.
You can run tests of Apple and 3rd party apps on the devices as well as Apple apps on Simulator by using XCUIApplication(bundleIdentifier:_)API. This way you can keep only your UI tests target, without any target app in target settings.
Example: https://github.com/rzakhar/xctest-assignment

Is bitcode required in order to allow users to download only the executable architecture needed for the target device?

My app size is huge, almost 100MB for an ordinary Mahjong game made with Unity3D. I'd like to provide smaller downloads for my audience.
Most of the problem comes from the executable code embedded in the fat binary (armv7 and arm64 architectures). I don't use a lot of images and using On Demand resources/levels does not make much sense in my game.
Looks like App Slicing feature from Apple is the way to go, since it allows iOS 9 users to download from the App Store the app variant containing only the executable architecture needed for the target device.
Since I'm using 3rd party frameworks that don't support bitcode, me question is:
Is bitcode support required for my purposes? Does the App Store require bitcode in order to 'slice' my app for iOS 9 users?
In case bitcode is not required, do I need to set my deployment target to iOS 9 or can I still support iOS >= 7 and take advantage of App Slicing for the iOS 9 users?
1) As you can see in the Apple Doc App Slicing and Bitcode are two different things so yeah, it will work iOS9 users
2) Same link
Note: Sliced apps are supported on devices running 9.0 and later; otherwise, the store delivers universal apps to customers.
So you can continue to target iOS7, Apple will do the job
N.

Is it possible to support iPad HD only device while releasing app to Apple AppStore?

Update:
iPad HD : iPad Retina (high resolution) (2048x1536)
iPad : Medium resolution (1024x768)
iphone : Low Resolution (below 1024x768)
I'm a c++ developer and mostly develop our apps on cocos2d-x to support cross platform.
Since we are supporting all device resolutions, we need to ship all resource contents (iphone, ipad and ipadhd) in one universal binary for Apple AppStore. The accumulative size is 38MB for our app and its already in the Apple AppStore.
We have been thinking about spliting app to support for iPhone, iPad and iPadHD separately. But in "xcode > Target > Devices", I can see only three options iPhone, iPad and Universal.
What I'm aware of?
If I go to support iPhone and iPad individually, I need two different names like AppName and AppName for iPad.
We can not use the existing name and bundle id, and continue to support only one of the target devices if it is already a universal binary.
What I want to accomplish?
I want to have three different packages for same app with three different names(or bundle id's) like AppName, AppName for iPad and AppName HD for Apple AppStore.
Packing only resources required to support the individual target device (I can use python scripting to remove irrelevant resource assets).
Whenever there is any update, release for individual target devices.
What is the issue?
How to support iPad HD only? I don't want to bundle ipad(12MB) and ipadhd(17MB) resources in one binary. Is it possible to accomplish this task?
If the above problem has no solution and I choose target device as iPad, Do I need to support iPad and iPad HD both?
Thanks
Manish, one solution is to "simply" download the large images after the user purchases the app. It's common with games that that happens. First you download the app off the app store, and then it says "Loading dragon costumes!" or whatever and then it downloads a half gig of dragon costumes.
Whatever platform you are using , Unity3D or whatever, there is usually a trivial way to do this (since most games do it).
BTW two points, (a) 38mb is nothing for a game, so forget that. and (b) you are very smart to only target users with modern machines. Users with old machines are cheap, they don't pay for stuff. It's all but pointless supporting anything less than iOS7, for example, unless you are the biggest most world-famous games.

Uploading Two different xcode files for the Same application as iPhone and Ipad

I have created an ipad application. I still haven't uploaded it to the app store, this application has a specific bundle ID.
Meanwhile, I was creating the same application content and features but compatible only with iPhone/Ipod devices.This application has a different bundle ID and a different Xcode file.
So, now i have two Xcode files, one for the iPad and the other one for iPhone, each one with different bundle IDs.
The next step would be uploading this application to the app store, so the situation is , how can i upload it and link two different xcode files together, one for ipad and the other for iPhone
keeping in mind, this is a paid application, so if the user has paid for it on his iPad, he should get the iphone version for free ( on the same App ID ) .
You cannot upload two versions of the same app to the app store.
I suggest consolidating into 1 file, a universal file that will work for BOTH iPhone or iPad.
Other option, would be to create a new app under a different name for iPad or iPhone / iPad only.
Excerpt from Apple's programming guide:
Creating a Universal App
A universal app is a single app that is optimized for iPhone, iPod
touch, and iPad devices. Providing a single binary that adapts to the
current device offers the best user experience but, of course,
involves extra work on your part. Because of the differences in device
screen sizes, most of your window, view, and view controller code for
iPad is likely to be very different from the code for iPhone and iPod
touch. In addition, there are things you must do to ensure your app
runs correctly on each device type.
Xcode provides built-in support for configuring universal apps. When
you create a new project, you can select whether you want to create a
device-specific project or a universal project. After you create your
project, you can change the supported set of devices for your app
target using the Summary pane. When changing from a single-device
project to a universal project, you must fill in the information for
the device type for which you are adding support.
Read the full version HERE

Submit separate binaries for iphone and ipad

How do I submit two separate binaries (one for iphone, one for ipad) in application loader? I'm using Ansca Mobile's Corona which doesn't support universal binaries.
A universal app is supposed to contain one binary that works with both iPads and iPhones -- you don't submit two binaries.
I do wish there was a way to do so, actually, as that would make it easier to submit separate versions of the app and price each of them differently...

Resources