[ios] cordova run with ios error .. Error code 65 for command: xcodebuild with args:

This error occur only when I try to cordova run ios --device

Even after cordova build ios command executed, non error is reported.

Whats I do wrong? And how to debug cordova projects on my iPhone (need this because need to test a Camera feature)

WITH CONFIGURATION Debug ===

Check dependencies
Code Sign error: No provisioning profiles found: No non–expired provisioning profiles were found.

** BUILD FAILED **


The following build commands failed:
        Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/ridermansb/Projects/jdapp/platforms/ios/cordova/build-debug.xcconfig,-project,CorrijaMe.xcodeproj,ARCHS=armv7 armv7s arm64,-target,CorrijaMe,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/ridermansb/Projects/jdapp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/ridermansb/Projects/jdapp/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/ridermansb/Projects/jdapp/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project

This question is related to ios iphone cordova cordova-plugins

The answer is


I must add :

I had the same problem, it was coming from the fact that my teammate had a different version of cordova, and commited plugins on the repo with his version.

For all cordova plugins, I had to :

cordova plugin rm <plugin-name> 
cordova plugin add <plugin-name>

And ask my teammate to update his cordova to match my version


Try to remove and add ios again

ionic cordova platform remove ios

ionic cordova platform add ios

Worked in my case


In my case it was the app icon PNG file... I mean, it took 1 day to go from the provided error

Error code 65 for command: xcodebuild with args:

to the human-readable one:

"the PNG file icon is no good for the picky Apple Xcode"


Open xCode can be exhausting if you do it everytime, so you need to add this flag :

  • cordova build ios --buildFlag="-UseModernBuildSystem=0"

OR if you have build.json file at the root of your project, you must add this lines:

 {
  "ios": {
    "debug": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    },
    "release": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
  }
}

Hope this will help in the future


I tried a few things in this scenario.

I removed ios and installed many times. Went down the path of deleting Splash screens to no avail! Bitcode on/off so many times.

However, after selecting a iOS provisioning team, and running pod update inside ./platforms/ios, I am pleased to announce this resolved my problems.

Hopefully you can try the same and get some resolution?


1) Open code in Xcode 2) Continue with : ionic cordova build ios


I was getting the same error when I tried to do :

cordova build ios

except mine said ** ARCHIVE FAILED ** rather than ** BUILD FAILED **.

I fixed it by opening the projectName.xcodeproj file in Xcode and then adjusting these 2 settings :

  1. In Targets > General > Signing ensure you have selected a Team

enter image description here

  1. In Targets > Build Settings > (search for "bitcode") set Enable Bitcode to "Yes"

enter image description here

Then I quit out of Xcode and reran cordova build ios and it worked.


How to do what @connor said:

iOS

  • Open platforms/ios on XCode
  • Find & Replace io.ionic.starter in all files for a unique identifier
  • Click the project to open settings
  • Signing > Select a team
  • Go to your device Settings > General > DeviceManagement
    • Trust your account/team
  • ionic cordova run ios --device --livereload

I had the same problem. In my case cordova platform update ios helped. The reason was in outdated version.


Same problem for me today, with "ARCHIVE FAILED". None of the solutions above worked for me, but watching closer, the error refers the path of module cordova-plugin-inappbrowser, so i removed the plugin, then added it again, and it finally works...

ionic cordova plugin remove cordova-plugin-inappbrowser
ionic cordova plugin add cordova-plugin-inappbrowser

stack :

Ionic cli 6.2.2
Ionic1 1.3.2
Cordova cli 9.0.0
Cordova platform ios 5.1.1
cordova-plugin-inappbrowser 3.2.0

Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to cordova

Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors after upgrading to Cordova Android 8? Xcode couldn't find any provisioning profiles matching Cordova app not displaying correctly on iPhone X (Simulator) JAVA_HOME is set to an invalid directory: ionic 2 - Error Could not find an installed version of Gradle either in Android Studio cordova Android requirements failed: "Could not find an installed version of Gradle" Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android Ionic 2: Cordova is not available. Make sure to include cordova.js or run in a device/simulator (running in emulator) Cordova : Requirements check failed for JDK 1.8 or greater Can't accept license agreement Android SDK Platform 24

Examples related to cordova-plugins

ionic 2 - Error Could not find an installed version of Gradle either in Android Studio cordova run with ios error .. Error code 65 for command: xcodebuild with args: Update cordova plugins in one command