How to fix "Command / bin / sh failed with exit code 1" issue on iphone

I used the cocoa static library in my application. When I compile my library, I got the following error:

Shell Script invocation error:can't open input file: /Users/sijuthomas/Library/Developer/Xcode/DerivedData/SCXML2- bbttehupryhijphhjdiemcytkvgy/Build/Products/Debug-iphonesimulator/ libSCXMLParser.a (No such file or directory) Command /bin/sh failed with exit code 1 

Screenshot for error

How can i fix this?

+53
shell iphone ios6 build-error
Oct 22
source share
14 answers

Target -> Build-Phases -> update examples

Check the box next to "Run launch" if it is not selected.

+150
Mar 23 '15 at 13:10
source share

It seems you are using a shell script and cannot find your file. Take a look at Target -> Build-Phases -> RunScript if you are using a script.

You can check if the script works in the output of the assembly (in the navigation bar). If your script does something wrong, the build phase will stop.

+30
Oct 22 '12 at 7:22
source share

Deleting Derivative Data worked for me.

In Xcode, go to Window> Projects> * Select a project> Click "Delete" next to "Derived Data"

+28
Aug 25 '15 at 20:17
source share

I had the same problem as fixed. To resolve the issue in Xcode 6.4, use the following steps.

  • Click "Show Project Navigator" in the "Navigator" window
  • Now select the project immediately below the navigator window.
  • Choose goals
  • Select the Build Phases tab.
  • Open Run Script dropdown
  • Select Run Script only when checked

Screenshot for steps

Now clear the project (cmd + shift + k) and create your project.

+14
Jul 23 '15 at 12:21
source share

Clearing the build folder (Cmd + Shift + Alt + K) worked for me

+5
Jun 07 '16 at 22:54 on
source share

Have you added the .a library to your xcode project? (project β†’ assembly phases β†’ Link to binary files with libraries β†’ click on the β€œ+” link β†’ β€œadd another” β†’ select your library)

And maybe the library is not compatible with the simulator, did you try to compile iDevice (and not the simulator)?

(I’m already fighting the second problem, I have a library that doesn’t work with the simulator, but with the real device that it compiles ...)

+1
Oct 22 '12 at 7:14
source share

I tried restarting Xcode (7) and nothing (you tried disabling it and enabling iOS again for me :-)). Then I tried to restart my box and it worked.

In my case, the script failed when copying a file from a location to another. I think this could be due to the distortion of the Finder with write permissions on certain folders.

0
Nov 10 '15 at 10:21
source share

For me, this error occurred due to the fact that I changed the version number from 1 to 1.0 and built a number from 6 to 1.1 when I pulled the code from the source tree. I just changed it and changed the build number from 6 to 7, and it worked fine.

0
Apr 20 '16 at 7:22
source share

In my case, there was a space in the path where the script crashed. If you use variables like $PROJECT_DIR or $TARGET_BUILD_DIR , replace them with "$PROJECT_DIR" or "$TARGET_BUILD_DIR" respectively. After adding the quotes, my script started successfully.

0
Jun 28 '16 at 9:24
source share

just put your script in a file and run this file with 2> / dev / null at the end of the command line!

Thus, if there is a problem with the command, it will not stop your xcode assembly

In my case, I only ran the command to delete my previous copy of the application from the connected iphone, so it could give an error if the iphone does not exist. To solve this problem:

$ mobiledevice uninstall_app com.my.app 2>/dev/null

0
Apr 09 '17 at 10:21 on
source share

For me, my certificate has expired. I created a new certificate.

0
Oct 25 '17 at 19:08
source share

The only thing that worked for me:

1) Delete Derived Data Using CleanMyMac: System Junk -> Xcode Junk -> Derived Xcode Data

Deleting Received Data Using CleanMyMac

2) Then in Xcode: Product -> Clean

0
Dec 09 '17 at 15:55
source share

Remove all containers and reinstall.

Steps:

  • comment on all containers and run pod install
  • uncomment all containers and run pod install
-2
Dec 13 '17 at 11:18
source share

swift 3

it worked for me

 Clean and run 

clean: - shift + cmd + k

-3
May 03 '17 at 4:59 a.m.
source share



All Articles