1

How do I create and build Cordova and Ionic Applications offline. Which files (Ionic and Cordova) do I need to download and which parameter(s) do I do to pass.

Each of these commands requires internet connection to create the project

cordova create test com.example.test TestME
cordova platform add android .....
ionic start test blank

I will like know how I can do all these offline.

Thanks in advance

Paullo
  • 2,038
  • 4
  • 25
  • 50
  • 1
    You cannot do this offline as you have two download both ionic and cordova. For plugins as well you ate required to be online – V31 Jul 16 '14 at 03:36
  • 1
    When you run cordova create commands, It download the base templates from internet. So you have to be connected to net. – vs4vijay Jul 17 '14 at 10:00

4 Answers4

0

download this archive or clone this github project https://github.com/driftyco/ionic-app-base then go to the www directory , and use the following commande python -m SimpleHTTPServer

0

Using the idea from Daniel Perez Alvarez in this question, I added this to my .bashrc file:

#################################
#
# It serves the current directory
# on port 3000 by default, but you
# can specify a port.
#
# Example:
#
#    ~/tmp $ serve                   # ~/tmp served on port 3000
#    ~/tmp $ cd ../www
#    ~/www $ serve 5000              # ~/www served on port 5000
#
# Credit: Daniel Perez Alvarez (https://stackoverflow.com/users/83998/daniel-perez-alvarez)
# SO answer on "serve current directory from command line".
# Link: (https://stackoverflow.com/questions/3108395/serve-current-directory-from-command-line)
#
#################################
function serve {
  port="${1:-3000}"
  ruby -run -e httpd . -p $port
}

I've been using this approach to test the Ionic Kitchen Sink app and other examples.

Community
  • 1
  • 1
Saul Martínez
  • 920
  • 13
  • 28
0

You can use npmbox !

npm addon utility for creating and installing from an archive file of an npm install, including dependencies. This lets you create a "box" of an installable package and move it to an offline system that will only install from that box.

So you can do something like $ npmbox ionic

But you have to have npm on the offline computer, you can download a node installer here

Joël
  • 1,563
  • 1
  • 18
  • 31
0

I had a similar problem, however the solution I used was quite tricky. If you have a machine with internet connection available to you, you could use a docker image with android and cordova already installed on your machine without internet. You will find many open-source images like this one: docker-cordova when searching for e.g. "cordova docker image". Running the docker on a machine with internet connection then building for the first time there, when you're done all the files needed are inside the container. Save the container with the extra files downloaded and pass it to the machine without internet connection. Running it as a container for your building phase.

Matt
  • 354
  • 1
  • 5