Is there a recommended way to distribute iOS apps to testers prior to publishing on the app store? - nativescript

I need to distribute my apps to testers prior to submitting them to the store(s). Nativescript builds an apk file that is easily distributed to Android testers. Is TestFlight the recommended way to distribute iOS apps? And should I use the xcode project file to build the app in Xcode in order to submit it to TestFlight. That method seems counter intuitive.

Yes, ideally you would use TestFlight. It's also a perfect way for you to test your distribution build/signing etc since you would upload the exact same build that will end up on the App Store. In fact, if your testing goes well with your users, you can submit the same build that you've already uploaded for TestFlight to the reviewers for the App Store, you don't even need to upload a new build.

As #Dave Wood mentioned, yes, TestFlight should be the way to go forward as you do not need to re-build the app to submit for review to Apple.
Answer to your next question should I use the xcode project file to build the app in Xcode -
No
You can use the below commands to build and publish app to Apple store.
From the root folder of your app
tns build ios --release --for-device --bundle <Your Provision Profile>
this will show the path where it has created the .ipa file, then
tns publish ios --ipa <.ipa file>
this will ask your Apple ID and App Specific password and will process the actual App based on your appid mentioned in your package.json.
You can change the app version and App name in info.plist inside App Resources->ios folder.

Thanks. I realized this was the answer after I posted the question. I'm new to NativeScript, but not to iOS development. It occurred to me that once the app is uploaded to App Store Connect, I still control the activities of either posting or setting up TestFlight. Thank you.

Related

Build failed with CrashlyticsOrgIdException

I just integrated the new Firebase SDK following these instructions:
https://firebase.google.com/docs/crashlytics/get-started-new-sdk
It's working with debug builds, but I get this exception on release build:
java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id
Any idea?
I was having the same error when trying to build a release APK, but it wasn't going away.
I realized that you need to generate at least one crash in Firebase Crashlytics before your Org Id becomes available.
After my first crash was visible in the Firebase Crashlytics Report page, release build started working.
So, make sure to follow the Firebase doc and run a test crash in debug before you try to build release.
There seems to be a bug with the new firebase crashlytcs SDK where the Org Id is not generated unless the app is run with the firebase crashlytcs set up.
I followed the older sdk documentation which uses Fabric and ran the app with that. This is the older doc : https://firebase.google.com/docs/crashlytics/get-started?platform=android
Update to the new crashlytics SDK then and the project should build for you now. This is the new doc : https://firebase.google.com/docs/crashlytics/get-started-new-sdk?platform=android
You need to go through all steps in Firebase web console in Crashlytics section until you'll see:
Build and run your app
We'll be listening for your app to communicate with our servers.
Then you can build an apk.

Firebase Crashlytics for iOS - Why does it need a build phase? [duplicate]

I use the Crashlytics framework for crash collecting in iOS Apps.
When you use the framework, a "Build Phase" is added to your target that runs /Fabric/Fabric.framework/run <big-hex-blob> <another-even-biger-hex-blob>.
I'd love to know that these actually do – I'm not entirely happy with having external vendors' tools monkey about with my build, I'm old school like that.
Mike from Crashlytics and Fabric here.
The run script build phase is used, along with your <APIkey> and <BuildSecret>, to automatically handle the uploading of dSYMs so that you, and other developers, never need to manually upload one.
Similarly, the /Crashlytics.framework/submit command is used for distributions through Beta, our beta distribution service.

How do I upgrade Android native app to new version based on NativeScript while keeping data from old app?

I want to update an existing Android app (not made with NativeScript), with a new one (made with NativeScript).
The old app stored some user data in a SQLite database. I want this to survive the upgrade.
Now, I have the same app-id in the new app, as the old, so that part is in place. To test if the database survives though, I have started the Android Emulator with the old app, created a few records, then published the native script version using
tns run android --bundle --device=1
and this correctly replaces the old app with the new code, but at the same time it seems to wipe the database, which is otherwise correctly stored in /data/data/app-id/databases
Is this due to the tns deployment for debugging possibly starting out wiping the system, or something else ?
How do you guys test this?
Edit: Apparently the uninstalling after each compile, rather than upgrading is a known thing, tracked in their Github as issue #3382
tns run android --bundle produces a development version of APK which would not match the signature of your production version of APK built with native Android.
If you use the same signing certificate you used for the production native app while running app / building your {N} version of APK, then you will survive the upgrade by default.
So your command may look like
tns [build|run] android --bundle --release --keyStorePath /path/to/keystore --keyStorePassword keystore-password --keyStoreAlias keystore-alias --keyStoreAliasPassword keystore-alias-passwrd
Read more on docs.
Edit: CLI seems to have a known issue with tns run, instead of replacing the APK, it deletes the old version and installs new version. So it should not be a problem when you publish the APK built with tns build. Credits to #DimitarTachev.

iOS Unity3D game with Apple Watch companion

guys.
First goes the questions.
I need to combine different Xcode projects for iOS and watchOS. And I need automation for this.
Is it possible to set reference in iOS-Xcode project to watchOS-Xcode project, and setup outer project to build target iOS app with embedded watchOS app, by using targets of inner project? Is it possible to do such a thing with workspaces?
Are there exist some command line tools for managing Xcode project, like adding targets, changing build settings, setup build phases, add resources and so on?
Problem summary.
I'm currently developing video game with Unity3D for iOS and want to make a companion application for watchOS. The problem is that Unity doesn't have any built-in support for watchOS, thus I have to care about integration of watchOS part by myself.
I have Unity project for the game itself and different Xcode project for watchOS part of the game. Now I combine Unity-generated Xcode project with the necessary parts of watchOS project manually: I create WatchKit App target, then import necessary resources from the separate watchOS-project, setup build settings as required - and that do the thing, I get the game with Apple Watch support.
The thing is, that I need to do automation for this process. But I haven't found some useful information on this topic neither here (on stackoverflow), not did on official apple developers' site, not on unityanswers.com, nor in Xcode documentation.
Thanks in advance.

ionic build package error for ios - code sign error

I'm struggling in getting my app ready for submission to Apple App Store...
I have valid ios development and distribution certificates and provisioning profiles.
I can successfully build my app via Xcode using development certificates and provisioning profile and works fines on test device i.e. iPhone 4s.
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the Provisioning Profile to the production profile, the app builds successfully but when Xcode tries to run the app on the iPhone, it throws an error: 'App installation failed. A valid provisioning profile for this executable was not found'.
Not sure if the above is related, when I try to build the app using ionic package CLI command; 'ionic package build ios --release --profile [PROFILE-TAG]' I get this error:
CheckCheck dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
For info, I have created the ionic security profile as suggested here: Security Profiles
I'm using:
OS X El Capitan
Xcode 7.2.1
Cordova 6.0.0
Ionic version: 1.2.4
Happy to provide more info if required. Thank you.
As you have mentioned in the question
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the
Provisioning Profile to the production profile, the app builds
successfully but when Xcode tries to run the app on the iPhone, it
throws an error: 'App installation failed. A valid provisioning
profile for this executable was not found'.
You can't directly run the build with the production profile/certificate in the device, to directly run from the xcode you have to build it with the development provision profile
If you want to test your production build before submisson you can download it with the TestFlight, it will be easier and better way of checking the build as same build will go for the submisson
If you need help with testflight you can refer doc here:
Apple Doc:Beta testing with testfligjt
Apple Doc: Distribute your app with testflight
Ray wenderlich Testflight tutorial
App which signed with an App Store provisioning profile can only be installed that downloaded from App Store, and for testing production behavior, you can generate an Ad-Hoc profile to sign your app. Ad Hoc Provisioning Profiles in Depth and How to

Resources