How To make a hello world Mobile app With Apache cordova

Hey there;

Apache cordova is an excellent tool for generate multiple platforms applications. Lets Make a fast start for it;

1- Install cordova with NPM’s , thats easy with terminal

$ sudo npm install -g cordova

2- And lets create a hello app

$ cordova create hello com.example.hello HelloWorld

3- Due to create automatically creating splashscreen images run commands below

$ sudo npm install cordova-icon -g
$ sudo npm install cordova-splash -g

4- At this phase we need to have 2 different images , First one should 1240x1240px dimension square for icon.png, second one is  2208×2208px dimension has centered image with logo,

5- After creating two images we need to run commands below.

$ cordova-icon --config=config.xml --icon=icon.png
$ cordova-splash --config=config.xml --splash=splash.png

6- I want to test on Ios Simulator but , is there simulators available in my repo? Better to check with command below;

$ cordova emulate ios --list

If there is an output like below that looks fine;

Available iOS Simulators:
        iPhone-5s, 12.1
        iPhone-6, 12.1
        iPhone-6-Plus, 12.1
        iPhone-6s, 12.1
        iPhone-6s-Plus, 12.1
        iPhone-7, 12.1
        iPhone-7-Plus, 12.1
......

7- Any of those simulators is available , i want to use 8-Plus , you can use whatever you want

cordova emulate ios --target="iPhone-8-Plus, 12.1" --buildFlag="-UseModernBuildSystem=0"

8- Similar to Ios device lets check android devices:

$ cordova emulate android --list

After checking this find out last application step

cordova platform rm android
cordova platform add android

Leave a Reply

Your email address will not be published.