Unable to find command: platform add ios - ios

I have a old ionic project that run in version 1.3.3. And I updated to new version 5.4.16. But, when I try build the project using "ionic platform add ios"
Its doesn't work and I receive this message:
Unable to find command: platform add ios
I look for this in doc, but nothing done.
Is there anything I can do or some other command that replaces ionic platform add ios in newer versions?

It's: ionic cordova platform add ios
https://ionicframework.com/docs/cli/commands/cordova-platform

Related

defining the architecture specific cordova plugin libraries to use in capacitor/react project

As has been mentioned in https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/Building.md#apple-store-submission in order to submit the app to App Store we need to strip simulator (i386/x86_64) archs from WebRTC binary and as the very last step to do so it says:
Remove ios cordova platform if already added and add ios platform again (e.g. with a command cordova platform remove ios && cordova platform add ios) or remove and add only the plugin at your own risk.
I have a capacitor/react project in which I am using the above mentioned cordova plugin. And unfortunately you can not use cordova commands in capacitor/react environments!
How can I invoke such command in a capacitor/react project or is there any equivalent steps I can take to get the same result?
Those are cordova instructions, for Capacitor just run npx cap update ios or npx cap sync ios

Ionic building an IOS application

I have finished building and compiling the Android version of the application from my windows laptop.
But to run it on IOS, am I supposed to copy the application folder to a MAC computer and run "ionic run ios"?
Follow these steps.
Check whether Ionic is already installed in Mac by typing ionic -v.
If Ionic is already installed, type the following commands:
ionic platform add ios.
ionic build ios.
If Ionic is not installed yet,
First install Node.js in Mac.
Then install Cordova and Ionic by using this command:
npm install -g cordova ionic
Once done with the installation, use the above commands for adding platform and build.
Then you will able to see Xcode file in platform folder iOS.
Then you can ask iOS developer to generate ipa file for iOS build.
You should add ionic ios platform before build
ionic platform add ios
Read this link : Ionic build

Swift Cordova bridge undefined error

I'm following instructions at http://moduscreate.com/writing-a-cordova-plugin-in-swift-for-ios/ to generate a Swift based Cordova plugin for IOS.
When I get as far as adding the IOS platform via command 'cordova platform add ios' I'm expecting something like the example:
Adding ios project...
iOS project created with cordova-ios#4.0.1
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist#1" via npm
Installing "cordova-plugin-whitelist" for ios
Installing "cordova-plugin-add-swift-support" for ios
Update IOS build setting SWIFT_OBJC_BRIDGING_HEADER to:
/Users/simon/projects/modus/swiftplugin/modusechopluginswift/testapp2/platforms/ios/TestApp/Bridging-Header.h
Update IOS build setting EMBEDDED_CONTENT_CONTAINS_SWIFT to: YES
What I actually get is:
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.moduscreate.testapp
Name: TestApp
iOS project created with cordova-ios#4.2.1
Installing "cordova-plugin-add-swift-support" for ios
Error: undefined is not a function
The platforms folder has a generated IOS subfolder with content.
I assume the problem is with the cordova-plugin-add-swift-support plugin.
I'm running xCode 8.0 on macOS Sierra 10.12.
Does anybody have any ideas?
I'm the author of the tutorial you were following. I recently updated it to address changes for Swift 3, so if you want to try this with the latest Cordova, XCode 8.2 and Swift 3 syntax, I've produced a new tutorial here. Following this may solve your issues.

How to include phonegap application in the iOS

I am creating a phonegap application in ios and i am following below mentioned link
http://docs.phonegap.com/en/1.9.0/guide_getting-started_ios_index.md.html
It is said in the link that we need to download the phone gap, which i had done already
and then click on the cordova based application, but in my app I am not getting the options
to select the same.
So can anyone suggest how it can be done?
PhoneGap installation process has been changed. You will not get any template in Xcode and we can do is creating app in terminal
List of this you need to install phoneGap are
1. node.js
2. cordova
3. phonegap
first install node.js and then phone gap/cordova
once your installation is completed open terminal and then create a cordova based application
use this for creating process
http://cordova.apache.org/docs/en/3.3.0/guide_cli_index.md.html
this for plugins
http://docs.phonegap.com/en/3.4.0/cordova_plugins_pluginapis.md.html#Plugin%20APIs
cd to your workspace
cd /Users/xxxx/Desktop
create cordova project
cordova create your-project-name
cd to your project
cd your-project-name
add ios platform
cordova platform add ios
build your project using cordova build
cordova build ios
done !!
Reference: http://blog.revivalx.com/2014/02/21/crud-operation-using-jquery-mobile-on-android-part-1/

PhoneGap CLI "cordova build ios" failed

i have created a new hello world project using the following command,
cordova create hello com.example.hello HelloWorld
the project is created successfully, then i add the ios platform by
cordova platform add ios
and to verify i have it added correctly, i type
cordova platform list
the iOS platform is shown in the list. so at this point, according to the PhoneGap tutorial, i can use the command
cordova build ios
to build the iOS version of the project. however, i encounter the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
the results that i have googled are mostly concerning the android version, talking about the invalid environment path setting. i dont know if it is related since i can create and build a PhoneGap project targeting the android platform without problem.
here is my $PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm:/Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/tools
EDIT:
problem solved by re-installing xcode from app store
I had the same problem in Android platform, and it was solved with the commands:
cordova platform rm android
cordova platform add android
cordova build android
in Node.Js console. try it in ios.
If you get an error with 'cordova platform add android', you may need to manually remove any android folders in your project folder hierarchy.
This resolved my issue:
cordova platform remove ios
cordova platform add ios
cordova build ios
If you run the build with --verbose, you will probably see some permission issues. By default, XCode creates a folder of the build in ~/Developer, if you haven't changed it. There probably is a permissions issue when creating that folder. Just execute the following command: sudo cordova bulid ios
That should fix your issue.

Resources