Do not try to run the app on device if you have not run the app on the browser first.
Install platforms, plugins and crosswalk:
npm run restore
All the necessary plugins will be installed as well:
config.xml
is setup to work by default but you will need to add the app id, app name, app description, author email and name. Make sure you do so before releasing in the stores.
- Android SDK
- Ant
Make sure you have the latest version of:
- Android Support Repository
- Android Support Library
- Goole Play Services
- Google Repository
Download the SDK from https://developer.android.com/sdk/installing/index.html?pkg=tools. Android Studio is not required.
Move the SDK to a place on your file system and refer to it on the .bashrc
or .bash_profile
file.
export ANDROID_HOME=~/Library/Android/sdk
Once it is done, you may need to run source ~/.bashrc
or source ~/.bash_profile
to update the configuration
# iOS
brew install ant
# Linux
sudo apt-get install ant
Plug your device in if you have one (make sure your device is listed by running: $ adb devices
) or let Android emulator handle it.
# Dump dev files within the www folder and run android in debug mode
npm run android
Open Chrome and dump this in the address bar: chrome://inspect/#devices
If your device is connected and in USB mode you will see your application that you can inspect using Chrome dev tools.
By default WPHC uses Crosswalk. It generates 2 apks that are around 28MB. If this is too big for your customers you can enable Crosswalk lite that way:
In config.xml
change <preference name="xwalkMode" value="embedded" />
to <preference name="xwalkMode" value="lite" />
The size of the apks generated will be half the size as you can see below:
- OSX
- XCode
- iOS Simulator
- Provisioning profile
Also you will need to Assign Your App to a Team: Project > General > Signing > Select your team ID in the dropdown
You will also need to disable bitcode (see iOS9)
You will need to disabled bitcode: Project > Build Settings > Build Options > Enable Bitcode = No
sudo npm install -g ios-sim ios-deploy
You should have a Xcode project file located in /platforms/ios/*.xcodeproj
. Open it by double clicking it.
Plug your device in if you have one or let iOS simulator handle it.
# Dump dev files within the www folder and run iOS in debug mode
npm run iosEmulator
For details about various requirements to deploy to a device, refer to the Cordova article: Getting Started with iOS. Briefly, you need to do the following before deploying:
- Join the Apple iOS Developer Program.
- Generate a certificate http://wiki.genexus.com/commwiki/servlet/hwiki?Create+a+Certificate+Signing+Request+in+a+MAC,
- Create a Provisioning Profile within the iOS Provisioning Portal. You can use its Development Provisioning Assistant to create and install the profile and certificate Xcode requires.
- Verify that the Code Signing section's Code Signing Identity within the project settings is set to your provisioning profile name.
# Dump dev files within the www folder and run iOS in debug mode
npm run ios
Add you webservice URL to the config.xml
file
<allow-navigation href="http://example.com/*" />
More details: https://github.com/apache/cordova-plugin-whitelist
To have logs dump in the terminal you can use --consolelogs
options
npm run ios -- --consolelogs