nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Cannot run on iOS: Command xcrun with arguments simctl install...An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1)

Open s-ale opened this issue 6 years ago • 25 comments

Environment ✔ Getting NativeScript components versions information... ✔ Component nativescript has 4.2.4 version and is up to date. ✔ Component tns-core-modules has 4.2.1 version and is up to date. ✔ Component tns-android has 4.2.0 version and is up to date. ✔ Component tns-ios has 4.2.0 version and is up to date.

Dependencies:

"dependencies": { "@angular/animations": "~6.0.6", "@angular/common": "~6.0.6", "@angular/compiler": "~6.0.6", "@angular/core": "~6.0.6", "@angular/forms": "~6.0.6", "@angular/http": "~6.0.6", "@angular/platform-browser": "~6.0.6", "@angular/platform-browser-dynamic": "~6.0.6", "@angular/router": "~6.0.6", "nativescript-android-utils": "^1.0.2", "nativescript-angular": "~6.0.6", "nativescript-drop-down": "^4.0.1", "nativescript-geolocation": "^4.3.1", "nativescript-gradient": "^2.0.1", "nativescript-localstorage": "^2.0.0", "nativescript-modal-datetimepicker": "^1.1.7", "nativescript-plugin-firebase": "^7.1.6", "nativescript-theme-core": "~1.0.4", "nativescript-toast": "^1.4.6", "nativescript-ui-sidedrawer": "~4.1.0", "reflect-metadata": "~0.1.10", "rxjs": "~6.1.0", "tns-core-modules": "^4.2.1", "zone.js": "~0.8.18" },

Describe the bug Just finished to configure Firebase for Android to:

  • receiving push notification (<-- ok)
  • displaying adv (<-- ok)

It works ok

(Nb. To let "nativescript-plugin-firebase" work with "nativescript-geolocation", I had to write this line in the app.gradle: project.ext { googlePlayServicesVersion = "15.0.1" } )

Now I'm trying to run on iOS (after removing the platform ios from the folder, to let the runner generate it from zero): tns run ios

But I'm getting this error during the installation: Unable to apply changes on device: 314852F5-762C-4287-8565-3081236DB5A0. Error is: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.RswIpe/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist

Is there some trouble between nativescript and geolocation also for iOS?

Thank you

s-ale avatar Oct 22 '18 15:10 s-ale

Hi @s-ale,

As we fixed some issues related to xcrun in rc version of {N} CLI, I'd like to ask you to update your NativeScript.

npm un -g nativescript
npm i -g nativescript@rc

Let me know if this fixes the issue on your side.

Fatme avatar Oct 23 '18 07:10 Fatme

Hi @Fatme

Just followed your instructions, but the problem remains. Here's the part of the log around that which I get the error in:

npm run ios --log trace

` ... ... AfterHookName for command shouldPrepare is after-shouldPrepare Skipping prepare. Installing on device 314852F5-762C-4287-8565-3081236DB5A0... Project dir from hooksArgs is: undefined. Hooks directories: [ '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/hooks' ] BeforeHookName for command install is before-install 12:27:13 - File change detected. Starting incremental compilation... 12:27:14 - Compilation complete. Watching for file changes. 12:27:15 - File change detected. Starting incremental compilation... 12:27:16 - Compilation complete. Watching for file changes. 12:27:19 - File change detected. Starting incremental compilation... 12:27:20 - Compilation complete. Watching for file changes. 12:27:23 - File change detected. Starting incremental compilation... 12:27:23 - Compilation complete. Watching for file changes. 12:27:53 - File change detected. Starting incremental compilation... 12:27:54 - Compilation complete. Watching for file changes. Unable to apply changes on device: 314852F5-762C-4287-8565-3081236DB5A0. Error is: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.cvgNuZ/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist . Will emit event liveSyncError with data { error: Error: Command xcrun with arguments simctl install 314852F5-762C-4287-8565-3081236DB5A0 /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/platforms/ios/build/emulator/meteobycentrometeoitaliano.app failed with exit code 1. Error output: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1): This app could not be installed at this time. Underlying error (domain=MIInstallerErrorDomain, code=11): Bundle at path /Users/alessandro/Library/Developer/CoreSimulator/Devices/314852F5-762C-4287-8565-3081236DB5A0/data/Library/Caches/com.apple.mobile.installd.staging/temp.cvgNuZ/extracted/meteobycentrometeoitaliano.app has missing or invalid CFBundleExecutable in its Info.plist

   at ChildProcess.childProcess.on (/Users/alessandro/.npm-global/lib/node_modules/nativescript/node_modules/ios-sim-portable/lib/child-process.js:56:28)
   at emitTwo (events.js:125:13)
   at ChildProcess.emit (events.js:213:7)
   at maybeClose (internal/child_process.js:897:16)
   at Socket.stream.socket.on (internal/child_process.js:340:11)
   at emitOne (events.js:115:13)
   at Socket.emit (events.js:210:7)
   at Pipe._handle.close [as _onclose] (net.js:549:12),

deviceIdentifier: '314852F5-762C-4287-8565-3081236DB5A0', projectDir: '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano', applicationIdentifier: 'com.meteo.italia' } Project dir from hooksArgs is: /Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano. Hooks directories: [ '/Users/alessandro/Documents/Progetti/cmi-app-nativescript/meteo-by-centrometeoitaliano/hooks' ] ... ... ... `

I hope that this is gonna be useful

Thanks :)

s-ale avatar Oct 23 '18 10:10 s-ale

same issue for me

enrico-atzeni avatar Oct 24 '18 07:10 enrico-atzeni

I'm having this error, but only when using --template tns-template-hello-world on tns create

diegozen avatar Oct 30 '18 11:10 diegozen

Also having this issue, but it didn't start to appear until I tried adding the https://github.com/dapriett/nativescript-google-maps-sdk plugin.

chrillewoodz avatar Nov 01 '18 08:11 chrillewoodz

@s-ale, @enrico-atzeni, @DiegoZen, @chrillewoodz

I removed the following from App_Resources/iOS/Info.plist and was able to reproduce the problem.

<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>

So can you please check if you have the above code in your App_Resources/iOS/Info.plist? Can you please check platforms/iOS/<projectName>/<projectName>-Info.plist as well?

Maybe some hook modifies the Info.plist file under the App_Resources and it remains broken.

Fatme avatar Nov 01 '18 08:11 Fatme

Hey guys, I also have this problem, Is anyone fix it ? please tell me , It's drive me crazy :(

liam-nirvana avatar Nov 07 '18 11:11 liam-nirvana

Deleting platforms/ios folder and do tns run ios worked to me !

diegozen avatar Nov 07 '18 22:11 diegozen

Hey guys, do you reproduce the error, can we close this issue?

rosen-vladimirov avatar May 22 '19 21:05 rosen-vladimirov

any solution ?????

hamzamalfawaer avatar Jun 17 '19 11:06 hamzamalfawaer

@hamzamalfawaer , what is the issue you are facing, do you have steps to reproduce. Please, whenever you ask for help, provide all the required information in the issue template. We cannot help you without getting full information for the issue, circumstances, etc.

rosen-vladimirov avatar Jun 20 '19 20:06 rosen-vladimirov

@rosen-vladimirov I've changed to nativescript v6 using angular and everything worked perfectly

But still can provide info about previous version of app to help others if faced same problem just let me know which info should I send

hamzamalfawaer avatar Jun 20 '19 21:06 hamzamalfawaer

Hey @hamzamalfawaer , Can you provide the following information:

  • your package.json content
  • command with which you reproduce the error
  • iOS Simulator version (i.e. what kind is the iOS Simulator and what is the iOS version)
  • macOS version
  • exact steps which you execute when the issue occurs

rosen-vladimirov avatar Jun 24 '19 05:06 rosen-vladimirov

@rosen-vladimirov

  • package.json :
{
  "nativescript": {
    "id": "org.nativescript.app4",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "scripts": {
    "lint": "tslint \"app/**/*.ts\""
  },
  "dependencies": {
    "app4": "0.0.0",
    "nativescript-animated-circle": "^1.2.0",
    "nativescript-pdf-view": "^2.0.1",
    "nativescript-pdf-viewer": "^3.1.0",
    "nativescript-plugin-firebase": "^8.3.2",
    "nativescript-slides": "^2.3.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "^6.3.0",
    "nativescript-ui-sidedrawer": "~6.0.0",
    "node": "^10.15.3",
    "node-sass": "^4.9.0",
    "rxjs": "~6.3.0",
    "tns-core-modules": "^5.4.0",
    "tsc": "^1.20150623.0",
    "typescript": "^3.4.5",
    "uglifyjs-webpack-plugin": "^2.1.3"
  },
  "devDependencies": {
    "nativescript-dev-sass": "~1.7.0",
    "nativescript-dev-typescript": "~0.9.0",
    "nativescript-dev-webpack": "^0.24.1",
    "tns-platform-declarations": "^6.0.0-next-2019-06-17-201500-04",
    "tslint": "~5.11.0"
  },
  "gitHead": "803cec054c44c99eaa59cdc267993e6346f6cb3a",
  "readme": "NativeScript Application"
}
  • command with which you reproduce the error : tns run ios
  • iOS Simulator version : iphone 7 / ios 12 (using xcode simulator)
  • macOS version : 10.14.5
  • exact steps which you execute when the issue occurs : after app installation on the device it try to run it but unexpectedly it fails

hamzamalfawaer avatar Jun 24 '19 07:06 hamzamalfawaer

I ran into this when using NS Sidekick and renaming the root directory of my project. If NS Sidekick project name (immutable) and your directory name get out of sync, it can't find it

kleingtm avatar Aug 14 '19 03:08 kleingtm

I had the same issue today, i was trying to configure Info.plist, to be more precise:

    <key>CFBundleDisplayName</key>
	<string>${PRODUCT_NAME}</string>
	<key>CFBundleExecutable</key>
	<string>${EXECUTABLE_NAME}</string>

Looks like i cannot set the name in that file, what i end up doing was, let it be, and open xcode do my changes there, generate the build, publish it and no problem, but every time i want to do publish my app ill have to do all this process again.

Any updates on this?

aosi87 avatar Sep 30 '20 17:09 aosi87

Has anyone found a solution?

I get this error every time I try to execute tns run ios

Unable to apply changes on device: 8A979AA6-F863-4DBF-9DE4-96ECC5317FDD. Error is: Command xcrun with arguments simctl install 8A979AA6-F863-4DBF-9DE4-96ECC5317FDD /Users/thorbilsby/Desktop/nameit/platforms/ios/build/Debug-iphonesimulator/nameit.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/thorbilsby/Library/Developer/CoreSimulator/Devices/8A979AA6-F863-4DBF-9DE4-96ECC5317FDD/data/Bundle/Application/8C58AEF6-884E-4BEC-A4A2-054E28B2CA18/nameit.app/nameit : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
	Failed to chmod /Users/thorbilsby/Library/Developer/CoreSimulator/Devices/8A979AA6-F863-4DBF-9DE4-96ECC5317FDD/data/Bundle/Application/8C58AEF6-884E-4BEC-A4A2-054E28B2CA18/nameit.app/nameit : No such file or directory

thorvaldemar avatar Oct 30 '20 11:10 thorvaldemar

I solved this issue by reverting to nativescript 6.8.0 from 7.2.0 I did so after reading the following post - apparently xcode 11.x.x is not supported for nativescript 7

https://nativescript.org/blog/nativescript-6-7-xcode-compatibility/

Posting the details of my original error / environment below - in case it helps others identify the same problem.

Error

Unable to apply changes on device: B389CF57-E430-4111-8C97-0802FE3C73A2. Error is: Command xcrun with arguments simctl install B389CF57-E430-4111-8C97-0802FE3C73A2 Users/xxxx/Documents/dev/library-app-starter/ablankapp/platforms/ios/build/Debug-iphonesimulator/ablankapp.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/xxxx/Library/Developer/CoreSimulator/Devices/B389CF57-E430-4111-8C97-0802FE3C73A2/data/Bundle/Application/26E18A63-5F6D-4E8E-953F-2375E9AD4917/ablankapp.app/ablankapp : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
	Failed to chmod /Users/xxxx/Library/Developer/CoreSimulator/Devices/B389CF57-E430-4111-8C97-0802FE3C73A2/data/Bundle/Application/26E18A63-5F6D-4E8E-953F-2375E9AD4917/ablankapp.app/ablankapp : No such file or directory

Environment

  • OS : OSX 10.14.6
  • CLI: 7.2.0
  • Cross-platform modules: ?
  • Android Runtime: -
  • iOS Runtime: @nativescript/ios has 7.2.0
  • XCode Version: Version 11.3.1

To Reproduce

ns create --js npm install ns run ios --emulator

Context I had tried making changes to the Info.plist in App_resources, running ns clean, and 'Erase all content & settings' using the simulator, and I've tried updating the version of nativescript/core

pageSwanson avatar Feb 28 '21 03:02 pageSwanson

I have the same issue even for the latest version: NativeScript: 8.0.1 Xcode: 12.4 iOS: 14.4

cupidchan avatar Apr 19 '21 22:04 cupidchan

Same here, deleting platforms folder don't seems to work.

javierpal avatar May 12 '21 04:05 javierpal

Same issue for

  • Xcode 11.7

  • NativeScript 8.0.2

  • iOS 10.15.7

Any resolution?

tdarr-okbu avatar May 12 '21 20:05 tdarr-okbu

Same issue here.

  • xcode 12
  • nativescrip 8.0.2

msimicshauma avatar May 13 '21 22:05 msimicshauma

Same issue here.

  • xcode 11.3.1
  • 8.0.2 Just tried to install a template ns create ExpenseTracker --template @nativescript/template-tab-navigation-ng

chakravarthiponmudi avatar May 14 '21 16:05 chakravarthiponmudi

I figure this issue a few months back, looks like that my project was build using the companion app, then updated to current versions, current versions handle this properties in different files, so be careful when you update or move from one version to another, what i end up doing was to redo my configurations and move my SRC code to the new generated project.

hope this helps.

aosi87 avatar Oct 01 '21 04:10 aosi87

Same issue here running the default hello app:

Mojave: 10.14.6
Xcode: 11.3.1
iPhone 11 Pro -- Max 13.3

Log (app name: hellonativescriptvue):

Unable to apply changes on device: $DEVICE_ID. Error is: Command xcrun with arguments simctl install $DEVICE_ID /Users/$USER/path/to/app/platforms/ios/build/Debug-iphonesimulator/hellonativescriptvue.app failed with exit code 1. Error output:
 An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
This app could not be installed at this time.
Could not install at this time.
Failed to chmod /Users/mac/Library/Developer/CoreSimulator/Devices/$DEVICE_ID/data/Bundle/Application/$APP_ID/hellonativescriptvue.app/hellonativescriptvue : No such file or directory
Underlying error (domain=MIInstallerErrorDomain, code=4):
	Failed to chmod /Users/$USER/Library/Developer/CoreSimulator/Devices/$DEVICE_ID/data/Bundle/Application/$APP_ID/hellonativescriptvue.app/hellonativescriptvue : No such file or directory

The command ns deploy ios raises the same error.

bitsnaps avatar Oct 07 '22 09:10 bitsnaps