Ori Idan
Ori Idan

Reputation: 153

Native script IOS deployment

We are trying to build iOS application using NativeScript sidekick on a Linux machine. We got to the stage where it asks for certificate and provisioning profile. How do we get these files? We have a paid Apple developer Id. We created a certificate but it downloads a CER and we have no Idea what extension sidekick needs (it is not CER for sure). How do we create the file that sidekick needs? It also asks for a provisioning profile how do we get this?

Upvotes: 0

Views: 525

Answers (2)

Ori Idan
Ori Idan

Reputation: 153

Finally solved it. Note I have no MAC, only Linux.

NativeScript Sidekick requires two files: Certificate with extension: p12 Mobile provisioning file with extension: mobileprovision

To get the P12 file we first need to create a key: openssl genrsa -out ios_distribution.key 2048 Then create a sign request file (CSR) openssl req -new -key ios_distribution.key -out ios_distribution.csr In FQDN field enter the bundle id. Click enter for password (no password)

Go to apple developer website, under certificates Click + for new certificate. Choose either development or distribution, upload the CSR file created previously, you will then see a download button to download a CER file. Download it. Convert it to PEM using the following command: openssl x509 -inform der -in ios_development.cer -out ios_development.pem Note that ios_development.cer is the file you just downloaded.

Download the file: AppleWWDRCA.cer from: https://www.apple.com/certificateauthority/

Convert it to PEM using: openssl x509 -in AppleWWDRCA.cer -inform DER -out AppleWWDRCA.pem -outform PEM

Create the P12 file using: openssl pkcs12 -export -out ios_development.p12 -inkey ios_distribution.key -in aps.pem -certfile AppleWWDRCA.pem

In order to create a provisioning profile you will need to create a new app. id, this is done from apple developer under identifiers. After you have an identifier you can create a provisioning profile.

I don't understand why it has to be so complicated and why there is no guide how to do it?

Upvotes: 0

FrontEnd-er
FrontEnd-er

Reputation: 663

You want to publish your ios application on app store you use command prompt it's very simple and fastly publish your app on app store. So first set your app store configuration in project directory App_resources -> iOS -> build.xconfig file.

Step-1:- build.xconfig

// You can add custom settings here
// for example you can uncomment the following line to force distribution code signing
CODE_SIGN_IDENTITY = iOS Distribution 
// To build for device with XCode 8 you need to specify your development team.
DEVELOPMENT_TEAM = Your_Team_Id
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;

Step 2:- Execute this command for run project in Simulator.

tns run ios --bundle

Step 3:- Build iOS project and generate relase ipa file for publish your application.

tns build ios --for-device --release --provision Your-Provision-UUID-Number --bundle webpack --env.uglify--env.*

Step 4:- Upload release ipa build on app store.

1. Upload iOS Package And Build On App Store With Bundle Using This Command

tns appstore upload --bundle AppleID AppleID-Specific-Password provision-distribution-UUID "iOS Distribution"

OR

2. Upload iOS build on App Store With IPA File Using This Command.

 tns appstore upload --bundle Your-AppleID Your-AppleID-Specific-Password --ipa "D:/project/platform/ios/build/Release-iphoneos/demo.ipa"

Upvotes: 2

Related Questions