Part 3/6 – Native packaging using Sencha Cmd – Packaging for iOS Simulator


In this article we will see how can we package our example application for iOS Simulator and test it on an iPhone simulator.

Getting ready

Make sure that you have setup the sample project by following Part 1.

How to do it…

Follow the below mentioned steps:
1.  Create iossim.json file and save the following content inside it:

{
 "applicationName":"TouchApp",
 "applicationId":"com.senchatouch.app",
 "versionString":"1.0",
 "versionCode":"1",
 "icon": {
 "57":"resources/icons/Icon.png",
 "72":"resources/icons/Icon~ipad.png",
 "114":"resources/icons/Icon@2x.png",
 "144":"resources/icons/Icon~ipad@2x.png"
 },
 "inputPath":"./", "outputPath":"../build/", 
 "configuration":"Debug", "notificationConfiguration":"debug", "platform":"iOSSimulator", 
 "deviceType":"Universal", 
 "orientations": [ "portrait"
 ]
}

2.  Run the following command inside <your project folder>/native/TouchApp folder:

sencha app package run iossim.json

This will launch the iPhone simulator and run the application inside it. You shall see the following output when the application is run successfully:
9185OS_11_04

How it works…

In the above application we defined the build and package configuration inside the iossim.json file and used the same to package the application for iOSSimulator and run it on the simulator.

Refer to the default packager.json generated in Setting up sample project for native packaging recipe for complete list of configuration that can be specified for different platforms and their documentation.

configuration and notificationConfiguration is set to Debug and debug, respectively, as long as you are testing your application. Once you are done with the testing and plan to publish the application to the stores, set them to release mode.

There’s more…

In case, you have a need to support multiple orientations in your application, then let us see how we can extend the orientations array to achieve it.

Supporting other orientations

To support multiple orientations, we can pass additional values to the orientations array. Following are the valid list of values that we can pass to the array:

  • portrait
  • landscapeLeft
  • landscapeRight
  • portraitUpsideDown

You can test your application for a specific orientation by passing the desired orientation value to the array and after the testing is completed, you can add the list to the array.

References

Co-founder of Walking Tree, Speaker, Sencha Trainer, Author of Sencha Charts Essentials, Sencha Touch Cookbook, Sencha MVC Architecture, and ADempiere Cookbook.

Tagged with: , , , , ,
Posted in Sencha Touch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Do More. With Sencha.

Recent Publication
%d bloggers like this: