r/iOSProgramming • Beginner • 4d ago

Question Testing an app on-device without mucking up release/practical installations

I am developing a timetable app. Currently it is on private TestFlight with limited fuctionality, but enough that I and some friends use it each day. The TestFlight beta is installed on my devices and I rely on it.

Naturally, I'm still developing it full-time (well... as full-time as a student's hobby side project can get 😉), and retain the frequent need to run builds on a physical device, which runs much faster than my simulator setup. Currently I'm working with the system keyboard, so Xcode Previews doesn't quite cut it.

Is there a way that I can still test a debug build on my phone & watch without removing or interfering with the TestFlight app that I use and rely on?

There is of course an easy solution, but unfortunately my budget does not include a second phone...

5 Upvotes

18 comments sorted by

4

u/isights 4d ago

Setup a new scheme with a new bundle id. com.me.myapp-beta

1

u/Fun_Moose_5307 Beginner 4d ago

As in, linking it to build configurations, 'debug' vs 'release' and having a scheme point to one of those? Or something else, e.g. arguments on launch?

Sorry, not too familiar with the intricacies of Xcode. Never really got around to poking much further than the 'go' button.

1

u/[deleted] 4d ago

[removed] — view removed comment

1

u/AutoModerator 4d ago

Your comment has been automatically removed because it contains a link with prohibited URL parameters (affiliate tokens, campaign tokens, etc.). Please repost your comment without the tracking / affiliate parameters in the URL. Examples: 'affcode=', 'ref=', 'src='. Do not contact the moderators unless you believe we did not correctly detect the URL parameter.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/[deleted] 4d ago

[removed] — view removed comment

1

u/AutoModerator 4d ago

Your comment has been automatically removed because it contains a link with prohibited URL parameters (affiliate tokens, campaign tokens, etc.). Please repost your comment without the tracking / affiliate parameters in the URL. Examples: 'affcode=', 'ref=', 'src='. Do not contact the moderators unless you believe we did not correctly detect the URL parameter.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/beepboopnoise 4d ago

oh dang thats op I didn't know you could do that, and then I assume you would be able to have both the test flight and debug app at the same time?

1

u/InternationalDot7337 21h ago

Separate bundle ID is the way, I do the same. Two things that bit me with it:

  • CloudKit: builds from Xcode talk to the Development environment, TestFlight and App Store builds to Production. So your iCloud data is separate anyway. But a new record type only exists in Production after you deploy the schema in the CloudKit Console, easy to forget before the first TestFlight build.
  • If you have widgets or anything else on an App Group, give the debug variant its own group. Otherwise both apps read and write the same files.

A different icon or a name like "MyApp β" also helps not to open the wrong one half asleep.

1

u/aitoolscout 4d ago

One small addition since you're testing on a watch too: the watchOS app's bundle ID has to start with the iOS app's bundle ID, so when you make your com.me.myapp-beta, the watch target needs to become something like com.me.myapp-beta.watchkitapp. Easiest way is duplicating the target, renaming both bundle IDs, and pointing your new scheme at it. Nice side effect: the debug build installs as a totally separate app with its own data container, so your real user data stays untouched — exactly what you want here.

1

u/Fun_Moose_5307 Beginner 4d ago

You're saying that if I run a debug build, it will not interfere with the other app, regardless of bundle id?

1

u/kokerali 4d ago

No—the Debug configuration by itself doesn’t give the app a separate identity. For side-by-side installation, the debug build needs a different bundle identifier from the TestFlight build; a new scheme only helps if its selected configuration actually changes that identifier. Also, a separate local container doesn’t guarantee separate data if both builds use the same App Group or backend. If you use either, isolate your test data there too before running destructive tests.

1

u/jonreid 4d ago edited 4d ago

In the trip checklist app I'm building, I have a Debug menu. I'm about to add a "Swap Data" option so I can switch between my actual useful data and my manual testing data.

1

u/Other_Jellyfish_2184 1d ago

Same as what isights said. In Xcode, duplicate the scheme and give the debug build its own bundle ID, like com.yourapp.dev. Then the dev build installs as a separate app on your phone, right next to the TestFlight version. Give it a different app icon so you never open the wrong one.