README
cordova_ios_for_windows
Preparation
- Install Node.js:
- Go to https://nodejs.org/en/ and download the installer that mentions "LTS" on the big green button
- Execute the file you downloaded to install Node on your computer
- Open a command prompt (Windows [Start] -> type "Command Prompt" -> Start with a click or [Enter])
- Confirm that Node is installed by typing
node -v
and executing with [Enter]. This should output the version of node you downloaded and installed:
(Your version number may be different)C:\Users\Jan>node -v v10.15.1
- Install Cordova:
- In the command prompt, execute
npm install -g cordova
- Confirm that Cordova was successfully installed by executing
cordova -v
. This should output a Cordova version:C:\Users\Jan>cordova -v 8.1.2 (cordova-lib@8.1.1)
- In the command prompt, execute
- Install cordova_ios_for_windows:
- Execute
npm install -g cordova_ios_for_windows
- Confirm successful installation with
cordova_ios_for_windows -v
. This should output the same version as the previous step.C:\Users\Jan>cordova_ios_for_windows -v 8.1.2 (cordova-lib@8.1.1)
- Execute
You successfully installed all the tools required to continue. 🌱
Update to current version
If you already installed cordova_ios_for_windows
before and want to update:
- Execute
npm install -g cordova_ios_for_windows
again
Create and configure the app
- Make sure you are in a safe location: Your command prompt should be at
C:\Users\%username%
right now, so entercd Documents
to go to your Documents folder. Then runexplorer .
to open an Explorer window in the same location. - Create a new Cordova project with
cordova create app
. This will create a new folderapp
in your current folder. - Go into the new folder with
cd app
. - Add the Cordova iOS platform with
cordova platform add ios@5.0.0
(You can confirm it worked by runningcordova platform list
)
You now have a Cordova app in C:\Users\%username%\app
that already has the iOS platform added and is ready to be adapted and built. 🌷
Adapt your app
- Run
cordova serve
to be able to look at the default app included. Open the URL the command outputs in your browser, then clickios
to look at it. - Use [Ctrl] + [C] to exit the running
serve
. - You can now create your web app in
www
. - If you only want to test the build process as quick as possible, just open
C:\Users\%username%\Documents\www\index.html
in your favorite text editor (both Notepad and Notepad++ work!) and replace everything between<body>
and</body>
with a simple sentence of your choice, then save the file. - Execute
cordova serve
again and open the URL in your browser to see your adapted app with the adapted page content. - Then exit the running
serve
with [Ctrl] + [C] again.
Now you have an app that is worth deploying to a device 🌻
Configure your app
Here is a list of common tasks that you want to do, besides building your web app in www
:
- Change the app package name / bundle identifier
- Edit
config.xml
and replace theid
value of<widget>
with something customized to you
- Edit
- Change the app and app display name
- Change the app icon and splash screen
Build your app for a simulator
You can use cordova build ios
to build your app for an iOS simulator.
Unfortunately there is no working simulator for Windows, so you can skip this.
Prepare codesigning
Apps for iOS need to be "codesigned" to be able to be run on real iOS devices or to be uploaded to the App Store. Apple's instructions are of course fully focused on doing this on a Mac, with tools and software that is not available for Windows. Fortunately, there is a simple workaround for all these steps.
To be able to codesign an app, we need the following files and information:
- Development team ID
- App ID
- Certificates
- Provisioning Profiles
Follow the instructions in codesign.md to get all these files and information and save them in a format that works for Cordova on Windows.
Build your app for a real device and install it on your device
- Build your app for iOS development:
cordova build ios --device
- Install the app on your iPhone by scanning the QR code and following the instructions on screen.
You successfully built an iOS app and installed it on your smartphone! 💐
Build your app for the App Store and upload it
- Build your app for iOS distribution:
cordova build ios --device --release
- Install the app on your iPhone by scanning the QR code and following the instructions on screen. Note that you can install, but not launch it as it is only meant to be uploaded to the App Store.
☠️ Future Functionality
- Download the resulting
.ipa
file for upload
Upload the distribution version of your app to App Store Connect
- Put .ipa in location
- Execute
upload
and supply username and application specific password- Application specific password from appleid.apple.com
- Now you can access this build in TestFlight or release it as a normal app
☠️ Future Functionality
Test and debug your app
- Connect to your app running on your smartphone to debug it: ???
- Run your app on an emulator: ???