Deploy two seperate iOS apps via PhoneGap with the same certificate/provisioning file - ios

We'd like to deploy two apps onto our iPad, using the same code base and configuration. The only difference being one points to our test environment, and the other to our production environment.
I'm using the build.phonegap.com service (this may or may not be relevant), and so far I've tried to change the Name and Id (i.e. com.company.app) in the config.xml file, but everything I deploy and download, the app overwrites itself. As mentioned above, we want two apps at the same time on the device, pointing to different environments.
I have a hunch that I may need to use a different certificate for each app (so that it is built with a different bundle id i.e. com.company.app)
Any thoughts?

You definitely need to build each app with a different BundleID if you want them to show up as separate apps on the device. However, you can use the same certificate/profile as long as you set up the profile to contain both BundleIDs, or some wildcard that will match both BundleIDs.

Related

Universal links for iOS apps - how it works?

I am new to adding universal links to iOS applications. I have read some materials but still have a few questions below. Any pointer will be greatly appreciated!
When exactly Apple will crawl my domain and inspect the [domain]/apple-app-site-association content? I have a new domain, and I'm wondering how Apple's crawler can discover it?
What's the recommended way to test universal links locally before publishing the first version of my app?
Is version control for universal links not possible? For example, the app 1.0 version only supports \item universal link, but app 2.0 version supports one more schema \details . If I specify both paths in apple-app-site-association, then the 1.0 app will break when user navigate to \details. (Edit: I noticed that if the app appropriately set it to be unhandled, then we can still fall back to browser.)
Thanks!
When a device downloads an app, it looks for an entitlements file to list out your associated domains. When it finds that your app has associated domains, it will check those domains for the aasa and download it onto the device. The aasa for that app will only be downloaded on install and update so changes you make will not effect all of your apps.
For testing you can host your AASA on a testing domain or on your production domain. It's up to you but you have to remember to update your entitlements file when you push it to production to ensure that you have the right domain configured. Every time you rebuild the app, it should re-download the aasa so testing shouldn't be too difficult. Always remember to paste the link in notes and not type it into Safari. Universal links only work when they are tapped, not typed in.
For your example you should make sure your new AASA is published at the exact time you publish your app. You should probably use a separate testing domain to host your AASA. You can just include both domains in your entitlements.
Branch actually has testing environment and AASA hosting built in if you'd prefer not to handle all of that on your own. They also leverage URI schemes in cases where Universal Links don't work.

Why is a new project with the same app ID still designated a new location?

We have created a new project with the same app ID, but this is designated a different folder in isolated storage. Why is this?
file:///Users/houman/Library/Developer/CoreSimulator/Devices/FBFFFF1E-B5C8-4541-AB4B-ED1657D43EB9/data/Containers/Data/Application/EB3A549F-1604-4E5C-8FBE-3076A3D581E5/Documents/
file:///Users/houman/Library/Developer/CoreSimulator/Devices/FBFFFF1E-B5C8-4541-AB4B-ED1657D43EB9/data/Containers/Data/Application/22E1E792-1F4F-4F05-B7D9-F61AD3624EE9/Documents/
Even though the apps share the same ID.
Since they don’t share the same location, no core data migration can take place.
Any advice please?
Update:
We have two apps in the AppStore and would like to combine the functionality. Hence the idea is to use the appID of the other app to push a new release from a separate project. We have the appID and right certificates, but the isolated storage seems to depend on something else than just appid. Without that a migration of existing data to the new system won't be possible. Alternatively we could copy and paste all files into the other project and go through lots of pain. That might make it possible.
I have seen this on my end - I believe (and could be wrong) that each simulator you run in gets its own folder on the disk. If you switch for iPhone 5 to iPhone 6s for example you may end up with a different folder.
I always actually (when running in the simulator) print out the on-disk location so that I can take a look at the sqlite file if i need to and recently (as of xcode7) i've noticed this directory change between runs - however in my case i tracked it down to changing simulator versions.
Mainly for security reasons. Every iOS application is placed in an application sandbox.
This not only refer to an application's sandbox directory in the file system, granting security by limiting the access to user data stored on the device, system services, and hardware.

How deploy two different apps in ios without having them overwritten

I want to have two version of the same IOS app to stay in the same time in the same device, one for testing and the other for production.
The app is built using phonegap build, so what I have done is
using two different bundle id specified in build.xml (edit: config.xml), so that one is dk.xxxDev.mobile, and the other one is dk.xxx.mobile
having two different apps in the apple developer page, so now I still have the previous one for dk.xxx.mobile and the new one dk.xxxDev.mobile
building using two different provisioning file, one for each app (one is using a developer profile, while the other is using an ad hoc certificate, but i guess we don't care about it)
Still, every time I deploy using itunes or testflightapp, one app overwrites the other one! What am I doing wrong?
edit: I Also changed
- the tag "name" in the build.xml (so that testflightapp can distinguish them )
- I'm using different filnames when I add the app to iTunes
Can you check if the 2 versions of the app generate are using the same IPA file name?
The file naming convention for the Mpbile Apps is as follows:
app_name.version.IPA file
iTunes in the Mac or in the PC store the mobile apps in IPA format and if they are using the same name, installing one will override the other. This is a valid question for Apple Support and this is something that a future version of iTunes may fix.
I was doing something different from what I wrote, I was probably using the same certificate for both versions.
So doing exactly what I wrote, it is supposed to work.
You need to change bundle identifier of one of the apps
Select Project in Xcode, then select target and in general tab you will see bundle identifier string.
e.g. com.YourCompane.AppName change "AppName"

Submitting a branched iOS project (same project name) to app store process

I have a base project, which I would like to re-brand and resell for clients. So my question is: When I branch and create a new project obviously it needs to be a separate entity from the main. Is the only thing that separates these apps during submission the Bundle ID?
Since renaming projects can sometimes be a pain, what I'm doing is:
Creating the branch
Opening it in XCode and changing the Target name, and this changes the bundle ID because it's set to com.whatever.${PRODUCT_NAME:rfc1034identifier}.
So I'm wondering when submitting a new project, is the bundle ID the only thing that needs to be globally unique? or are there more attributes that I would need to change for each new branch/project?
Thanks
From my experience, only the bundle ID needs to be different.
A few things you should notice though:
You probably want the app splash screen / icon / icon label to be different between clients too
Under Build Settings your Code Signing Entity might need to be different too. If you have certificates+provisioning profiles which are specific to the bundle ID, you would have to create new sets of those for every client and use them when building
If you see that you're starting to change resources (like the icon / images for branding / string tables) between clients, using multiple projects and a shared static library may be easier for you. Take all of your shared code and convert it to a static library iOS project, and then create a separate project per client (normal iOS app project) which uses this library. This way all the metadata (like bundle ID, certificates, icons) can be different, and the code be the same.
If your app defines any URL schemes (for example, if you implement login with Facebook you need to do this), these schemes should be different between clients too. If they are the same, you are bound to have collisions when a user installs 2 apps on their device.
And one last tip regarding Apple policy:
If you are planning to submit all of these client apps under your developer account, this may be against Apple policy and your apps might be rejected. Apple wants you to open a dev account (and pay the $99/year) per client..

iOS: Running different apps on device

I'm a novice iOS developer and got my iOS developer program account, I setup the iOS certificate and Provisioning Profile and I can run my test app on my device(iPad). My question is if I want to run different test apps(imagine couple Apple sample codes) on my device without replacing the last tested app on my device(I mean keep all of them on my device at the end of test) what would be the trick here? I know each app has it's own bundle identifier, but how to manage this scenario for running all of them on the device with the same iOS Certificate/Provisioning Profile?
Just change the Name of the project and it should refactor. Change the name on the root of files & folders in xcode. You can click on it and it'll let you change the name. In Build Settings Properties change the name under there as well. Click at the very top of your list of files where it says the name of your project and it'll bring up the build properties.
If I understood you correctly, there are two parts of your questions:
Yes, you can run many (distinct) apps on your device.
To have multiple version of the same app running on your device, all you need is change app's product name to a different name, app1, app2, etc. It is a relatively easy process to do it. This SO Q/Aenter link description here has the instructions. You do not need to rename your project or any thing else. Just make a copy of the project and follow the instructions to make a new product name.

Resources