Sunday, March 12, 2017

Sencha Touch - Native iOS Provisioning

Sencha touch provides native IOS provisioning feature.
Below are the steps to create an install a native application on device running iOS for development and testing.
Step to run an application on an iOS device.

  1. Create, download and convert an iOS certificate
  2. Create application id
  3. Register Device
  4. Create and download a Provisional profile
After apple development portal steps are done follow following steps:
  1. Configure the application package Configuration.
  2. Generate application
  3. Run package application

Create, download and convert an iOS certificate

All native iOS application needed iOS certificate. One certificate can be used for multiple application so once you have created a certificate use the same across application
Follow the steps to create iOS certificate which are same for windows, MacOs but the commands are different.
  1. Generate certificate signing request(CSR).
  2. This is the prerequisite to create iOS certificate. You can use app builder to create CSR. You should be logged in to the app builder and should have your app code running in it.
    Click cogwheel icon and select option then select iOS cryptographic identity and click create, enter your details and click OK.
    Once you click OK it may prompt to specify name and location to save the downloaded file, provide that.
    Cryptographic certificates comes in P12 format.
  3. Go to the Apple Development Portal and follow the steps :
  4. Once you have CSR with you log in to the iOS development center click on the certificate section.
    Click certificate then development and click Add.
    Select iOS development center and click continue.
    Now provide your CSR and click continue again.
    Click download for downloading generated certificate and click done.

Create application id

Application id which is also known as bundle id is a unique string which identifies you application.
You can use same id for development purpose but for production each application should use unique id. Id can be created from apple development center.

Register Device

You need to register your device in apple development center if not already done. All devices needs to be registered once.
To register a device you may need UDID, its unique id of the device which you gate with iTune from your device.
To check your UDID open iTunes in your computer and connect you device to it. Click its name under the device list and go to the summary page. Then click the serial number which is UDID for your device.
To add your device click the add device option in portal and provide your UDID.

Create and download a Provisional profile

This step is to link your iOS certificate, application id and device to run application.
To generate provisioning profile give a name to profile and provide your appId and iOS certificate with device information.
Now generate and download the provisioning profile. Default name for the provisioning profile file would be _profileName_.mobile provision where profilename is the name you provide during provisioning.

Configure the application package Configuration.

Next step is to crate packager for you application. Run the following command to generate packager. You can edit the packager and provide you application Id and other relevant information specific to your application.
sencha app package generate packager.json

Generate application

Now build your application using following command in sencha CMD.
sencha app build native 

Run package application

Once all the above points are done you can finally test your application on iOS device.
Now launch iTunes and go to the Apps library and add your .app directory to the Apps screen.
Finally in your device go to apps and choose the app from Apps library, install and launch the app. You will see your app running successfully.

No comments:

Post a Comment