I'm trying to run a Cordova app on iPhone from VS Code, but it doesn't work. When I click "Run iOS on device", the app is generated and installed successfully, but I get an error when starting to debug, and the app doesn't run.
Installed package /Users/fabio/Projects/Agenda/Agenda/platforms/ios/build/device/Agenda Taba.app
------ Debug phase ------
Starting debug of ca207dcd1809c811dd3cc485c4625900d884f532 (N71mAP, iPhone 6s, iphoneos, arm64) a.k.a. 'iPhone de Fabio' connected through USB...
[ 0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
2020-11-01 17:52:30.687 ios-deploy[10250:206758] [ !! ] Error 0xe8000022: The service is invalid. AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL)
ios-deploy: Command failed with exit code 253
I think this error may be related to another error that is shown when the "build" starts:
2020-11-01 17:52:08.688 xcodebuild[10071:205637] [MT] iPhoneConnect: <DVTiOSDevice (0x7fbffea0b950), iPhone de Fabio, iPhone, 14.0.1 (18A393), ca207dcd1809c811dd3cc485c4625900d884f532> == Underlying device preparation errors ==
2020-11-01 17:52:08.689 xcodebuild[10071:205637] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fbffbe31840:'com.apple.platform.iphoneos':<DVTFilePath:0x7fbffbe316c0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7fbffea0b950), iPhone de Fabio, iPhone, 14.0.1 (18A393), ca207dcd1809c811dd3cc485c4625900d884f532>";
}
In Xcode "Devices and Simulators" this error is shown with a little difference:
Failure Reason: allowsSecureServices: 0. isConnected: 1.
I have found a few posts about this iPhoneConnect error 5, but none of them solved my problem. I tried to reboot iPhone and Mac, "unpair device" in Xcode, disconnect cable, cordova remove platform and add it back.
This is the first time I'm trying to run this app on iPhone. I have developed it for Android on Windows, and now I'm migrating to iOS. I am new to Apple environment.
If I run the app from Xcode, it works as expected, including debug info output ("console.log()"). Running Cordova from command line, I get the same error as in VS Code.
My "build.json" looks like:
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "BDASUGH234",
"packageType": "development",
"automaticProvisioning": true,
"buildFlag": [
"-UseModernBuildSystem=0"
]
},
...
Versions:
- iPhone 6S - iOS 14.0.1
- Xcode 12.1 (12A7403)
- Cordova 10.0.0
- Cordova iOS platform 6.1.1
Any ideias, please?