How do you create multiple iOS apps from one Xcode Project? - ios

I have a Sencha Touch 2 app wrapped in a native shell with PhoneGap. I have already created the native Android app. With my native Android app I have one Project and one apk for that Project. I have managed to create several apps from the one apk. I use the apktool to unpackage the apk then use some Perl script to update the index.html file with some global JS variables and I change the package name in the Smali files to make the app unique. Then I repackage the apk and sign it. The only difference between each app is the name and the url to send requests. This variables are set in the index.html. I would like to do the same for my iOS app. Is there a way to do this without creating multiple projects? Each app needs to be unique so I can have multiple instances on my device.

This is what you need to do. Using your XCode project, create an ipa file. Now you can create mutiple copies of of your ipa file, change their bundle ids and resign them using a tool like iResign . Bundle Id identifies an app; so when bundle ids change and the app is resigned, you get a different app altogether!
Since now you have different bundle ids for apps in different environment, you need to use a plugin like wizUtils plugin and read the bundle identifier in your JS code and in a JS switch case statement, you can set dev and prod configurations(in your case service URLs) depending on the bundle id. So this way you don't have to change anything in the source code when you do the build for other environments.

Related

React native IOS app web-services works on simulator but not real IOS device

I have done with all the settings of my react native project and trying to run on the IOS simulator, it's working fine. Means all the api working properly.
So now I have to share my .ipa file to team members for testing, so creating .ipa file I am using procedure defined on react nativeRunning On Device documentation.
For creating .ipa file using Xcode following below process:-
In Edit Scheme option, change Build Configuration to release.
Clean Build Folder
Create Build.
Archive build.
After that exporting .ipa file using valid certificate.
Solutions I have tried:-
Checked with this solution, because the domain I am using to hit web service is not secured.(It's http)
Enable Transport security flag.
Added main.jbundle (created using command line) to Copy Bundle Resource option in Build Phases.
While adding Alert in api call, getting below error (check image)
Still No luck.
Please let me know, what I am doing wrong?
Please check api server live link is working or not. In my case, I am testing whole api's on local network (In LAN). But when trying with live url, I am also facing this issue.
So that time I made one mistake, that my url should contain http:// but in actual it was https://.
It's pointing to main.jsbundle file, that means it's having issue
related with your code.
So check it once.

delphi/IOS: How with PASERVER sign dynamic libraries before to deploy them?

To include a dynamic library in your iOS app, this dynamic library must be signed. When you deploy an app, Delphi automatically signs the app through the PASERVER. Is their anyway to order PASERVER to also sign the included dynamic libraries? (that are in the subfolder Frameworks/ of the app). Or is there any other way to automate this task?
Exactly i need to execute this line before to deploy the app :
"/usr/bin/codesign" -s "<myProfile>" "/Users/me/PAServer/scratch-dir/ALLiveVideoChatClient.app/Frameworks/WebRTC.framework/WebRTC"

How do I make an iOS app's Build Identifier dynamic?

I am working on some Swift code with my children. We would like to work from a shared codebase, so that we can each grab the code, then build and install the app onto our phones.
When I grab the source code my daughter wrote, I get the errors:
The app ID "com.example.OurApp" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
and:
Xcode couldn't find a provisioning profile matching 'com.example.OurApp'.
If I change the Bundle Identifier value in XCode to something globally unique, everything works. But I don't want to do that because then it is confusing what changes should be committed and/or shared.
The Bundle Identifier value seems to be statically attached to the project files, and those project files need to be checked into to source control, which means that we have to manually muck with that value before we can build and sign our app so that we can run it on our phone.
We each have a developer account that gives us the ability to sign an ipa with our certs, which allows us to install builds on our phone.
I think I want to make the Bundle Identifier dynamic based on the machine or user that is building it.
I think I want to type com.myfamily.$(SOME_ENV_VARIABLE).OurApp into the Bundle Identifier box in XCode, and then commit that file so that any of us can just grab the code, mess with the code, then install the signed ipa on our phone without changing any of the XCode project file values.
No matter what I type into the "Bundle Identifier" box in XCode, the resulting value in the plist within Build/Products/.../Info.plist is garbage. Even changing some .swift files causes this plist to change to some junk value.
How do I make it so that I can share an XCode project with my family such that we can each sign and run the app, without changing or git-ignoring any of the project files/plists?
We are using XCode 8.3.x and running iOS 10.

Xcode: sharing the same Bundle ID among multiple people

I'm developing an iOS app with a friend. We both enrolled for the Apple development program as a Single person (we don't have an organization).
We're using git and we'd like to be both able to build the app from our Mac, but I can't compile sinche the Bundle ID is already used by my friend. Is it even possible to be both able to work on the same project without being an organization? What we should do?
Thanks
The problem is that only one developer account can register the bundle ID. What Xcode is trying to do is register the bundle ID to your development account (as you can do manually at https://developer.apple.com). Since your friend already did this, you cannot do this as well.
What you can do is either change the value of your bundle ID to a development one (in the end, only one of you can release the app on the App Store) however, this is kind of messy since it'll change the .xcodeproj and can be a real conflict mess when using versioning (as I guess you are using).
Another option is to use .xcconfig files, and define the bundle ID dynamically in your project. This way you can change your config file locally and just don't push that change. What you do is:
Add a new file to your project. Select Other under iOS and then select Configuration Settings File. Save the file and call it Debug.xcconfig (or whatever you want).
Add the following row to the file: BUNDLE_ID = io.example.app.
Select your project in the Project Navigator and then select the project itself under PROJECT.
Select the Info tab and expand both Debug and Release. For both Debug and Release select the Debug option.
Now open your Info.plist file and change the value of Bundle Identifier (CFBundleIdentifier) to $(BUNDLE_ID).
Now you can change the bundle ID (and a shitload of other Xcode project properties) using the configuration file. You could add one for yourself and your friend as well, each with their own bundle ID.
One problem though when changing the BundleID is that services such as APNS won't work. Keep that in mind. If that is important that both should be able to test, then make sure to get an organisation account.
Hope this helped you a little bit!

Creating new Xcode project from an existing Project

I have one app with some app name in the App Store, is it possible to create a different app from the same project in the Xcode by changing the info plist values like bundle id ,bundle name etc with out creating a new project.And can i upload the same to the App Store with a different app name.
Thanks.
One way to do this is to create a second 'target' inside your existing XCode project.
There are a number of different target types you can create, one of them being another application.
This new application target then needs a different bundle id etc. However that target can see all the existing code you wrote for your existing app so you don't need to copy the files into another project to reuse them. Use the search facility in Apple dev website, or Google the use of XCode targets for more information about how to do this.

Resources