Testing app on iphone via xcode replaces my app (which is downloaded from app store) - ios

I want to be able to have 2 versions of my app on my phone. The one that is published on the App Store and the one that i use to test on my iphone via xcode. Unfortunately when i run my app on my iphone with xcode, it replaces the one i downloaded from the app store.
Is it possible to have both versions?

Change Bundle identifier of your project to something else. You can find it at info.plist

Related

WatchOS app not detecting companion iOS app

I am making an independent Apple Watch app (but with a companion iPhone app which is not necessary for the watch app to function.)
The app uses WatchConnectivity to sync data between devices if iPhone companion app is installed. I am able to call session.updateApplicationContext() on the iOS app and receive session(didReceiveApplicationContext) on the Watch app. But going the other way is not possible. I always get an NSError code of 7018 which means the iOS companion app is not installed.
I have made sure both watchOS and iOS app are installed in simulator (and tested on my actual devices, iPhone 11 & Watch series 5.) But getting the same failed results from watchOS -> iOS.
I noticed there is a new WCSession instance variable available for watchOS 6.0+ isCompanionAppInstalled. When I read this variable after my WCSession is activated on my watch app, it always return false.
Is there anything else I need to look out for? I am thinking maybe there is something I did wrong in all the different info.plist. But I have checked them multiple times.
my info.plist files:
In my watch app:
WKWatchKitApp is YES
WKCompanionAppBundleIdentifier is com.abc.myapp
In my watch extension:
App can run independently of companion iPhone app is YES
NSExtension
WKAppBundleIdentifier is com.abc.myapp.watchkitapp
NSExtensionPointIdentifier is com.apple.watchkit
iOS app bundle identifier is com.abc.myapp
watchOS app is com.abc.myapp.watchkitapp
watchOS app extension is com.abc.myapp.watchkitapp.watchkitextension
Is there anything else I might be overlooking?
Thank you very much for any help/insight you can offer into this.
Ok. I found a way to get rid of the error and have the watch connectivity work from watch to iPhone.
Originally I wanted the watch app to be independent so in the watch extension target in Xcode, the check box "Supports Running Without iOS App Installation" is checked. But as soon as I uncheck this box, WCSession.isCompanionAppInstalled returns true and error goes away. Syncing from watch to iPhone starts working.
So hopefully this is not intended behavior and will soon be fixed by Apple. (I filed a bug report.) But for now, I am just going to leave the independent watchOS app unchecked because I do want WatchConnectivity in case iPhone app is installed by user.
Thank you for reading and good luck with your programming.
If you have "App is only available as a standalone watchOS app" in Info.plist, delete it even if it is false. Leave only "App can run independently of companion iPhone app". Also don't forget to set "WKCompanionAppBundleIdentifier" for Watch App (not extension). At least it works on real device for me with these parameters.
This seems to be a bug. Sometimes when I start my WatchOS app, it gets WCSession.isCompanionAppInstalled = false all the time, even though the companion app on the iPhone is running, and other apps are able to communicate with the phone.
This seems to go away when I force-restart the app on the watch (press side button, then swipe the app to the left and press the big red button, then start the app again). After the restart, everything seems to work fine.
This has happened only on Testflight builds so far. If it happens in production builds, I'm going to file a bug.
My iOS app will not launch in the Simulator if I uncheck "Supports Running Without iOS App Installation".

How do I test code that runs on update for IOS apps?

My app contains code that must modify the DB in the documents directory on update of the app (because the structure of the DB has changed between versions).
The loading of the new version of the app to a phone via xcode works fine, and runs the code correctly. However I'm concerned that this may not exactly mirror what happens when updating via the app store on the phone.
In order to properly test that this code runs correctly when a user updates their app through the app store, I gather it used to be possible to load the app via an ad hoc distribution, which would install it as if it were an update from the app store. The (rather old) instructions for that are here:
https://developer.apple.com/library/archive/technotes/tn2285/_index.html
I attempted this, by exporting the ad hoc .ipa file and dragging onto the device in ITunes, only for it to tell me the app is already installed. The .ipa file contains the updated app and it has a higher version number than the one installed on the device.
Do I need to do this another way? Or is loading the app via xcode sufficient to emulate what the user's phone will do when updating the app?
Thanks

iOS - does App Store require iPad screenshots for upgraded iPhone app

Not sure if the App Store listing rules have changed, but I am planning on submitting a new app to the iOS App store soon. One of the previous versions of the app had the 'Universal' build type marked in XCode (done by another developer) and for the newer release, I only wanted to support iPhone. Is it still possible to submit the app for review like this? I don't want to go through the extra effort of taking iPad screenshots if I don't have to.

Update ios Appstore app to allow only iPhone

I have my application in apple app store supporting, iPhone,iPad and iPod (Universal), Now I want to have my app compatible with only iPhone, How to achieve that.(In xcode device family I can check only iPhone and sumbit app sotre, will this make my app only supporting iphone ) Please help
It is not possible with the original Bundle ID.
Citing from the doc below:
https://developer.apple.com/library/content/qa/qa1623/_index.html
Bundles must continue to support any devices previously supported.
The only option for you is to create a new bundle ID and submit your app with it.
Removing your app from the store, and uploading the update with a
different bundle ID, will allow you to narrow the range of devices
your update supports. However the update will be listed on the store
as a separate app.

Debug an iOS app while keeping existing data

I'm currently having a problem with an iOS app that we've only observed in production, in the App Store version.
I'm trying to test it by debugging a development version of the app from Xcode, with the same Bundle ID and everything, but it removes the existing App Store app before running the development version, hence removing all traces of the bug.
Is there any way to instruct Xcode not to remove an existing app when debugging?
P.S. My app is a Cordova app. I already tried attaching a Safari Web Inspector, but it turns out it doesn't detect published apps.

Resources