ionic-team / ionic-cli

The Ionic command-line interface
MIT License
1.99k stars 652 forks source link

Can't access app path ../ios/build/device/name.app : No such file or directory #1197

Closed huntmj01 closed 6 years ago

huntmj01 commented 8 years ago

Short description of the problem:

When creating a new project and then running it on an iPad I get a can't access path error. When following the path, the device folder appears to be missing as though it was never built.

What behavior are you expecting?

The CLI to run the app on my iPad.

Steps to reproduce:

  1. Create a new blank project. ionic start TEST2 blank
  2. Build the blank project. ionic build ios
  3. Run the project. ionic run ios
2016-07-22 10:21:06.364 ios-deploy[3580:121214] [ !! ] Can't access app path '/Users/huntmj/documents/Test2/platforms/ios/build/device/TEST2.app' : No such file or directory

Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/huntmj/documents/Test2/platforms/ios/build/device/TEST2.app

Other information:

When I navigate to ios/build/ their is no device folder:

screen shot 2016-07-22 at 10 34 53 am

Which Ionic Version? 2.x

Run ionic info from terminal/cmd prompt: (paste output below) Your system information:

Cordova CLI: 6.3.0 Ionic Framework Version: 1.3.1 Ionic CLI Version: 2.0.0-beta.32 Ionic App Lib Version: 2.0.0-beta.18 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.7 Xcode version: Xcode 7.3.1 Build version 7D1014

More detail terminal output

screen shot 2016-07-22 at 10 47 11 am

WhatsThatItsPat commented 8 years ago

Try it with the --device flag:

ionic run ios --device
huntmj01 commented 8 years ago

Son of a gun that worked. The --device flag added the device folder to the build folder. Thanks!!

I had one final error but all I had to do was run the project in xCode, add a provisioning profile, and ionic run ios --device ran the app on my iPad.

Code Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “com.ionicframework.test2374987” were found.

** BUILD FAILED **

The following build commands failed:
    Check dependencies

(1 failure)

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/huntmj/documents/Test2/platforms/ios/cordova/build-debug.xcconfig,-project,TEST2.xcodeproj,-target,TEST2,-configuration,Debug,-destination,platform=iOS,build,CONFIGURATION_BUILD_DIR=/Users/huntmj/documents/Test2/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/huntmj/documents/Test2/platforms/ios/build/sharedpch
WhatsThatItsPat commented 8 years ago

It's probably still an issue (though not sure if it's Ionic or Cordova). I think ionic run ios without the flag used to work for me, and a cordova upgrade broke it, but I lost track.

WhatsThatItsPat commented 8 years ago

That is to say you might want to leave the issue open, because ionic run ios should work without the flag.

huntmj01 commented 8 years ago

As per the recommendation of @patrickmcd, I am reopening the issue.

sagrawal31 commented 8 years ago

@MasterProgrammer200 the comment you mentioned is relative to provisioning profile. You need to create a test provisioning profile (XCode 7) allows you to create a test provisioning profile for development (without paying for Apple account). Let me know if you find it difficult to create provisioning profile.

But, yes, that --device flag should have documented or fixed as par @patrickmcd's comment.

levani commented 8 years ago

I still can't run the app on device.

Here is what I get after adding the --device flag:

Error: Error code 1 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/lm/test/platforms/ios/build/device/test.app

Caught exception: undefined

tonyawad88 commented 8 years ago

I am getting the same error as @MasterProgrammer200

2016-07-27 19:32:36.027 ios-deploy[17802:618056] [ !! ] Can't access app path '/Users/...../platforms/ios/build/device/App.app' : No such file or directory

Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/...../platforms/ios/build/device/App.app

Also same error when I run with --device. No provisioning profile...

Any workarounds ? Thank you !!

croustibat commented 8 years ago

like @patrickmcd has mentioned it, just add the --device after cordova/ionic run ios :

cordova run ios --device

and look in your platforms/ios/build/ directory if there's a /device directory. Cordova should copy all the compiled stuff in it.

asterix23 commented 8 years ago

I was seeing the same issue. Adding --device worked. Thanks!

davorpeic commented 8 years ago

Also experiencing this issue, but only after I changed my app name and rm/add ios platform.. before this it was working.. --device flag helped :)

10x

MarcGodard commented 8 years ago

Same issue but the build fails with --device

manojmeshram commented 8 years ago

I am facing same issue as reported by MasterProgrammer200 please help. I am not able run on ios device.

bastibense commented 8 years ago

Just came across this issue in the latest version as of this moment (2.0.0). Apparently adding --device works around this. I assume some kind of glitch in two places in the code where different defaults are provided for this behaviour.

nunoarruda commented 8 years ago

This issue still exists today:

screen shot 2016-09-29 at 22 49 02

Steps to reproduce:

  1. ionic start demo blank --v2
  2. ionic run ios

My Ionic info:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan (Wrong info by the cli, it's actually macOS Sierra)
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a
garrysaddington commented 8 years ago

Exactly the same issue today

Joncom commented 7 years ago

This seems to be a cordova issue. I just finished going through the cordova hello world example, and when I run cordova run ios, I get:

** BUILD SUCCEEDED **

[....] Waiting up to 1 seconds for iOS device to be connected
[....] Found iPhone 5s (GSM) 'iPhone' (<redacted>) connected through USB.
2016-10-05 22:44:23.378 ios-deploy[32337:930100] [ !! ] Can't access app path '/Library/WebServer/Documents/hello/platforms/ios/build/device/HelloWorld.app' : No such file or directory
Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Library/WebServer/Documents/hello/platforms/ios/build/device/HelloWorld.app

Adding the --device flag fixed the issue. Furthermore, after running with --device once, running the command again without the flag seems to work.

punchouty commented 7 years ago

Any workaround?

rrubio commented 7 years ago

Have you added your project to an xcode development group? i.e a valid developer account

antmrdevlabs commented 7 years ago

Same issue for me:

** BUILD SUCCEEDED **

[....] Waiting up to 1 seconds for iOS device to be connected

[....] Found iPhone 6s 'MyiPhone' (0e7a65c0f0a189d19cf56434e[...]) connected through USB.

2016-10-11 18:36:29.501 ios-deploy[26362:7165583] [ !! ] Can't access app path '/Users/[...]/platforms/ios/build/device/MyApp.app' : No such file or directory

Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/[...]/platforms/ios/build/device/MyApp.app
Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.0
Gulp local:  
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v4.4.4
Xcode version: Xcode 8.0 Build version 8A218a 
rrubio commented 7 years ago

If you're still having the same issue and project has been allocated a developer account under xcode, give the following a try:

  1. un install ios-deploy
  2. sudo npm install -g ios-deploy --unsafe-perm=true --allow-root
dhndeveloper commented 7 years ago

still having this issue as well

ionic run ios --device doesn't work for me

niether does

un install ios-deploy sudo npm install -g ios-deploy --unsafe-perm=true --allow-root

rrubio commented 7 years ago

@audan2009 just making sure, you have already attached your project under xcode to a developer account/team? Whenever i've had this error in the past, it's always because i've forgotten to assign a team to the project.

dhndeveloper commented 7 years ago

Yup. I had this working in beta 11 just fine. Same app Id

rrubio commented 7 years ago

Interesting. ionic Emmulator works fine? have you tried running it from xcode also?

dhndeveloper commented 7 years ago

Yes it does. I'm not sure how to run it from xcode.

rrubio commented 7 years ago

Open your project under xcode, from there click the play button. Your project file will be under plaforms -> ios -> project_name.xcodeproj

Double check that your project has the developer account assigned.

dhndeveloper commented 7 years ago

That worked! Looks like I didnt have it assigned... I didn't have to do that with beta 11.

Now that its on my phone theres 10 other things that don't work :(

rrubio commented 7 years ago

Awesome! well at least you can move forward now ;-)

antmrdevlabs commented 7 years ago

No, sorry. That didn't work either (npm (un)install ios-depoly + xcode dev account).

When i build and run the app from xcode it will be successfully deployed to my iphone via usb. From ionic's run command it still fails with the previously posted error message.

edit: ionic emulate --target="iPhone-5, 10.0" runs successful

rrubio commented 7 years ago

@athomer have you tried running it under Xcode? And dev account assigned?

antmrdevlabs commented 7 years ago

@rrubio yes, under xcode it builds and runs without errors. a dev account is assigned...

rrubio commented 7 years ago

If you haven't done so already, I would try removing platforms and re-add them.

That is -

  1. ionic platform rm ios
  2. ionic platform add ios

Also make sure you have the following installed -

  1. ios-sim
  2. ios-deploy
  3. cordova
antmrdevlabs commented 7 years ago

tried to remove the platform and add it again, but that didn't solve my problem. the needed tools (ios-sim, ios-deploy and cordova) are installed. a test with a newly created plain vanilla hello world rc0 app (ionic start ionicRc0 --v2) shows the same error:


CodeSign build/emulator/ionicRc0.app
    cd /Users/.../Desktop/DEV/apps/ionicRc0/platforms/ios
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin[...]"

Signing Identity:     "-"

    /usr/bin/codesign --force --sign - --timestamp=none /Users/.../Desktop/DEV/apps/ionicRc0/platforms/ios/build/emulator/ionicRc0.app

** BUILD SUCCEEDED **

[....] Waiting up to 1 seconds for iOS device to be connected

[....] Found iPhone 4S 'iPhone' (4ade41a012082c5a451032cef7ecb6a...) connected through USB.

2016-10-13 11:44:14.738 ios-deploy[65926:9276180] [ !! ] Can't access app path '/Users/.../Desktop/DEV/apps/ionicRc0/platforms/ios/build/device/ionicRc0.app' : No such file or directory

Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/.../Desktop/DEV/apps/ionicRc0/platforms/ios/build/device/ionicRc0.app
ThorstenHans commented 7 years ago

Had the same problem here.

I'm running latest developer beta on my phone and had selected according xCode beta on my Mac, but xCode-beta was not set as default xCode.

Got it working by executing sudo xcode-select -switch /Applications/Xcode-beta.app

snowcxt commented 7 years ago

Looks like ionic run ios will build the app under the emulator folder?

Signing Identity: "-"

/usr/bin/codesign --force --sign - --timestamp=none /Users/.../platforms/ios/build/emulator/myapp.app

/Users/.../platforms/ios/build/emulator/myapp.app: replacing existing signature

emulator should be device?

antmrdevlabs commented 7 years ago

@ThorstenHans i think my xcode version and paths are correct. i only use the latest build on my mac.

@snowcxt yes, it seems like that.

snowcxt commented 7 years ago

I ran ionic run ios but found this in the console:

Building project: /Users/.../platforms/ios/MissDolphin-Mobile.xcodeproj

    Configuration: Debug
    Platform: emulator
mdumouchel commented 7 years ago

So I also am having the following error. When I add the --device flag I get this error

Error: Error code 1 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b

I can deploy from xcode however and appears to work fine when I go that route.

I also removed my platform and added back same issue.

BARSHAHAF commented 7 years ago

i tryed everything and nothing help me until : i downgrade the cordova

use sudo npm install -g cordova@6.0.0 and also sudo npm install -g ios-deploy --unsafe-perm=true

than i hade premission xcode project error so i add the admin premission.

and wholla . that work !! (sory for my english :)

wethinkagile commented 7 years ago

Ok I wrote a gist of this in my blog: http://meshfields.de/ionic2-ios-local/

dezudas commented 7 years ago

+1 problem exist for me too, I can run it from xcode but not from terminal. I followed the provided instruction.

My OS: macOS Sierra

l3bel commented 7 years ago

I believe the "Can't access app path ..." issue can be solved by ALSO granting Cordova / Ionic write permissions to the project folder, as noticed by @BARSHAHAF EDIT / CLARIFICATION : both sudo npm install -g ios-deploy --unsafe-perm AND granting Cordova / Ionic write permissions to the project's folder were necessary for me

NewBen001 commented 7 years ago

This is most probably a Provisioning Profile Issue. Try to build the app using Xcode once and then try again.I fixed this issue.

ghost commented 7 years ago

https://forum.ionicframework.com/t/enoent-no-such-file-or-directory-stat-var-root-library-logs-coresimulator-792d38b1-e2ef-4547-ad8e-f2c3fa46f542-system-log/72775

pelzerim commented 7 years ago

Updating to latest cordova version 6.5.0 (sudo npm update -g cordova) and using "ionic run ios -l --device" fixed this issue for me. Tried everything else in this thread before, though.

frank10gm commented 7 years ago

it's a problem related to python module "six". Install six and try again.

easy_install six

bflopez commented 7 years ago

I just fixed this issue by trying to launch it through Xcode. It pops up an alert message telling me to check the Settings>General>Device Management to enable my phone as a trusted device.

jwuliger commented 7 years ago

I just ran into the problem myself. The only way I could run my app was using Xcode to build and deploy to my device. Xcode found many things wrong with the project as one would expect, but by using the recommend settings when it prompts you helps as well. It is a pain to do it this way.

uniquejava commented 7 years ago

I am creating ionic 1 projects, and met the same issue here, here is what I did:

Append --device flag: ionic run myApp --device, now that specific error disappears. but there is some other error .

Then I open the iOS project in Xcode8.2 and associate it with my developer certificate.

And now i am able to simply use ionic run ios to run it on my device. (but I have to wake up and unlock my device first, otherwise it will yell me below message:

2017-03-23 21:44:47.791 ios-deploy[29119:867835] [ !! ] Unable to mount developer disk image. (e80000e2)

Error: Error code 253 for command: ios-deploy with args: --justlaunch,--no-wifi,-d,-b,/Users/xxxxxx/myApp/platforms/ios/build/device/myApp.app

ionic info

Your system information:

Cordova CLI: 6.5.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 ios-deploy version: 1.9.1 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v6.10.0 Xcode version: Xcode 8.2.1 Build version 8C1002