Mysterious "cryptographic verification failure" error on macOS Sierra, Xcode 8 - ios

I have just updated and right away getting this error:
"error: A cryptographic verification failure has occurred."
Any ideas?
Edit: I have iOS 10

Simple solution:-
How I did [Working for me]
Step 1:- Go to this folder - from your finder press option Go - > Go to Folder
then type your project path like this example:- Library/Developer/Xcode/DerivedData/yourprojectname/Build/Products/Debug-iphoneos
Now you can see a window pop with list of available File, There you see yourApp.app file [ Don't do anything just wait for step 2].
Step 2:- Open new Terminal and type just cd then just drag step 1 yourApp.app to terminal, now you will get the path for the app, now press enter button.
Step 3:- Now type this command **
xattr -rc .
Don't miss "."(Dot) press enter button.
That's it, Go to your Xcode project and clean and run again.

Many people are having code signing errors with the first beta of Xcode 8. I would recommend using Xcode 7.3 until the next beta comes out.

From your project's root folder:
find . -type f -name '*.jpeg' -exec xattr -c {} \;
find . -type f -name '*.jpg' -exec xattr -c {} \;
find . -type f -name '*.png' -exec xattr -c {} \;
find . -type f -name '*.json' -exec xattr -c {} \;

Related

Is there any easier way to replace all the fonts that are set into the xib in xcode?

I want to replace a font family in xcode, what is the easier way to do it, one way is to go to every xib file and set the font again
Using the terminal, go to the project directory and run this command to replace all strings in the project with any new string:
Use it carefully, save changes before executing this:
LC_ALL=C find . -type f -name '*.xib' -exec sed -i '' 's/OLD_TEXT_TO_BE_REPLACED/NEW_TEXT/' {} +
example:
LC_ALL=C find . -type f -name '*.xib' -exec sed -i '' 's/name="AvenirNext-Regular" family="Avenir Next"/name="Gibson-Regular" family="Gibson"/' {} +
You can do it by opening the xib file as "Open as source code"
Now use Find and Replace [CMD + ALT + SHIFT + F] and replace the current font family with your font family.
You can do this for all of your storyboards or xib files

Copying all the contents of an xcode program to one document

I have a project where I have to submit all the code comprising my program.
However, I am using xcode and an MVC architecture, so my code is split into different files/folders plus the storyboard itself.
I am wondering if there is anyway for me to see all the lines of code in one document so I can copy and paste my CR easily instead of going through each page and copying its content.
Try to run these commands in the working directory using terminal
find . -name "*.swift" -type f -exec cat {} + > "combined.swift"
If you just wanted to copy all of them
find . -name "*.swift" -type f -exec cat {} + | pbcopy

For certain files in a directory carry out an action

I haven't worked with this stuff in years, so please be patient!
I'm having some really weird issues with Mac Excel greying out some .csv files but not others. From what I've read so far, this could have something to do with some of the more hidden file parameters.
Anyways, I'd like to find the files with a certain name in the directory, do a getfileinfo on them and spit out the result, i.e. something like:
for each i in (ls \*_xyz*.csv) do getfileinfo $i | echo
(or whatever more intelligent way this can be accomplished these days...)
I tried a few combinations but keep getting "-bash syntax error", so I've decided it's time to get help...
Thanks!!
Create dummy test files:
$ touch file{1..10}_xyz.csv
$ ls
file10_xyz.csv file1_xyz.csv file2_xyz.csv file3_xyz.csv file4_xyz.csv file5_xyz.csv file6_xyz.csv file7_xyz.csv file8_xyz.csv file9_xyz.csv
There are many ways to do this. My favorite is method1.
Method 1)
$ find . -name "*xyz*.csv" -exec someCommand {} \;
Method2)
$ for x in $( find . -name "*xyz*.csv") ; do someCommand $x ; done
Method3)
$find . -name "*xyz*.csv" | xargs someCommand

How to use here maps SDK for Swift 3?

I am trying to use the here maps SDK and I tried every step as mentioned on the provided link:
https://developer.here.com/news/20170208a#.WVn1zNN968p
I need help regarding the issue. Please help me if anyone has ever used the here maps SDK in iOS and Swift 3.
I hope this steps follow to solve error.
In terminal, goto project's root directory and execute one by one command
find . -type f -name '*.jpeg' -exec xattr -c {} \;
find . -type f -name '*.png' -exec xattr -c {} \;
find . -type f -name '*.tif' -exec xattr -c {} \;
Clean Xcode and Re Build. Done.

what does `{}` mean as a file name in output from egrep?

I am on ubuntu debian 12.04, and I ran a find command to add something to all of my python files:
find . iname "*.py" -exec echo "import os" >> {} \;
The command runs without error and I want to validate the results so I egrep all of the files:
egrep -in "import os" *
And I get results looking like this:
{}:35:import os
{}:36:import os
{}:37:import os
{}:38:import os
{}:39:import os
...and the numbers go until 51 for some reason. What does this mean?
Thank you.
Your first command:
find . iname "*.py" -exec echo "import os" >> {} \;
Is looking for files ending in .py, and for each one is putting the string "import os" in a file called {}. Presumably there are 51 matches.
So egrep, when you run it, the * matches all files, including your file called {}. With {}:35:import os it's telling you that "in the file {}, at line 35, there's the string you're looking for"
This command:
find . iname "*.py" -exec echo "import os" >> {} \;
...creates a file named {} (in bash, and other shells which honor redirections in positions other than head and tail -- this is an extension which the POSIX sh standard does not require). It does not modify the files found by find. (This is because the >> is acting as a command to the shell that's starting find; it's not modifying the behavior of -exec -- and even if it did, -exec directly uses execve() to invoke the command given; it doesn't start that command through a shell, so it doesn't honor shell constructs such as redirections, so you'd be passing literal >> as an argument to echo on any shells not implementing this extension, still not performing a redirection on the individual files found).
Now, if you did want to modify the files found by find, you might do so like this:
find . -iname '*.py' -exec sh -c 'for f; do echo "import os" >>"$f"; done' {} +
Noteworthy differences:
The redirection is invoked inside a shell started with exec sh; thus, there's a shell present to honor it after the individual filenames have been resolved.
-exec ... {} + is used, which is much more efficient than -exec ... {} ; (the former runs as few subcommands as possible; the latter runs one per file found).
{} is a placeholder that is replaced by find with the filename that matches the given condition, in this case {} is replaced with filename that match the pattern "*.py".
However your find command isn't actually doing that, as the >> {} is not actually part of the -exec block, but interpreted by the shell as a redirect for the whole find command, so the {} never gets replaced by find with the proper filename and instead you are redirecting into a file called {}. To make things more clear, the command you are actually executing is this:
find . iname "*.py" -exec echo "import os" \; >> {}
Meaning for every *.py file you add a line containing "import os" into a file called {}. The output of grep is just filename:linenumber:matched_line so you get a {} in there as that is the filename.
If you are wondering how the \; survives and why you are not getting a:
find: missing argument to `-exec'
The shell doesn't actually care where in the command line the redirect occurs:
echo 1 2 3 4 5 6 7 > foo
is the same as:
echo 1 2 > foo 3 4 5 6 7
and gives you this each time:
$ cat foo
1 2 3 4 5 6 7
Also worth to mention >> is an append operator, so even if you fix your command you are adding to the end of the Python files, while import os probably should go to the top of the file.

Resources