Running xcodebuild on command line, where to view logs? - xcode

I want to view the log when building an xcode (4.5) project from the command-line, since the output in the command-line window itself is too long and messy. Is there a standard place the logs would go, I can't seem to find them?

There are logs in ~/Library/Developer/Xcode/DerivedData -- you'll have to figure out which sub folder is for your build, but in there is Logs/Build/UUID.xcactivitylog
If you rename that file to a .zip and unzip, there's a text file log in there of the build.

Like all command line tools, output goes to standard output and error goes to standard error. By default this is your command line terminal. Use piping and/or redirection if you want them somewhere else. Check your command line interpreter documentation for more info (probably you are using bash, so check man bash).

Related

/usr/local/bin/vim: cannot execute binary file: Exec format error

Trying to learn more about the many mysteries of bash.
I have neovim installed. I have nvim aliased to vim. I have nvim configured to use my vim config.
Let's say I want to use the real vim command, though. which vim yields "/usr/local/bin/vim".
But calling /usr/local/bin/vim directly results in the error given in the title. Why is that? How can I run my vim command directly?
From the result of the file command it seems that the file in /usr/local/bin/vim is somehow broken (the system doesn't recognize it as an elf file).
The file command should identify any executable file with the file format (and other types of files). When this command returns output of data it means that it couldn't identify the file at all.
Since you found the vim executable in Cellar/vim/8.1.1000/bin/vim, you can use this file instead of file which is in /usr/local/bin/vim, or you can create the link by yourself, that should fix this error.
If you would create the link with absolute path instead of relative path, it should work.

How to go to a specific file in Mac Terminal?

I'm trying to follow a walkthrough and this is one of the steps, "go to that same folder in Terminal (if you can't do that you should probably quit now)" I'm not very familiar with Mac's Terminal, but don't feel like quitting. If it helps, I need to run a grep -r "what I'm looking for" command on the file. I really have no idea what I need to do to run that command, but the rest of the walkthrough is pretty thorough, so I know I can follow the next few steps.
You need to move to the directory where that file is stored, for this the command is cd. For example lets say the file is located in a directory names MyDir in the Desktop, the command will be
cd /Users/{YOUR_USERNAME_HERE}/Desktop/MyDir
You can run ls command here to check if the file is actually present in this directory or not

Getting file contents from TEE's Tf.Cmd command line

I am trying to get the file contents from a specific revision in TEE. According to https://msdn.microsoft.com/en-us/library/gg413270(v=vs.100).aspx the command should be something to the affect of : tf print -version:C1999 Class1.java. This is the error I am receiving:
An argument error occurred: The specified file does not exist at the specified version.
I know I am logged in and my credentials are cached as I am able to query for information like the History command. I also know that the file does exist in this revision as I am getting the information from the history query. Also using Tf.Exe (provided by visual studios) I am able to successfully run :
tf view -version:C1999 Class1.java
and get the contents perfectly fine. Unfortunately for this purpose I am unable to use tf.exe, and it has to the the TEE command line using Tf.Cmd, and they do not support the "view" command.
Any help on getting the file contents would be greatly appreciated.
edit- note I am using the full file path, and, as I said, it works perfectly fine in Tf.exe. Also I have tried using "$/" as the project root and still do not have any success.
Make sure you have installed the latest version of Team Explorer Everywhere.
To use this command, the Read permission on the file that you are
trying to print must be set to Allow.
Even though you could get tf view command to work. Also double check if you have related permission on that specific file.

Batch script calls a Bash script but output file does not populate

I have a batch script that looks like this
# echo off
c:/cygwin/bin/bash -li each_sec_extract.bash c:/iperfprocess/sprint/file1.txt > c:/iperfprocess/sprintbashed/file1.txt each_sec_extract.bash c:/iperfprocess/sprint/file2.txt > c:/iperfprocess/sprintbashed/file2.txt
When i run this as is, the CYGWIN bash terminal pops up and I can observe the script producing the output I want on the screen, however, when I go to the directory where the file should be located (c:/iperfprocess/sprintbashed/), I am greeted by an empty text file. When i enter instructions from the CMD line manually, I receive the same result. However, when I run the instruction directly from CYGWIN, it works flawlessly. The part that frustrates me the most, this script used to work fine, then I started getting SED: permission denied errors which forced me to run bash.exe in administrative mode.
Any ideas about what might be happening or what a solution may be? Thank you in advance for any and all help provided.
Is this any different?
#echo off
c:/cygwin/bin/bash -li each_sec_extract.bash c:/iperfprocess/sprint/file1.txt > c:/iperfprocess/sprintbashed/file1.txt
c:/cygwin/bin/bash -li each_sec_extract.bash c:/iperfprocess/sprint/file2.txt > c:/iperfprocess/sprintbashed/file2.txt
The SED: Permission error was the underlying cause of the empty output files that was experienced. Running bash in administrative privileges was only a work around that didn't fix the actual problem. For some reason, sed.exe became corrupt. The solution was comprised of downloading UnxUtils from http://sourceforge.net/projects/unxutils/?source=dlp and replacing the sed.exe found from CYGWIN/bin/ and replacing it with the one in the UnxUtils zip file.
I ran my script after these steps and everything worked perfectly as it did prior to the issue.

Add directory to system path in OS X Lion

I can't figure out how to add a directory to the system path. I found out that the command is something like this:
export PATH=$PATH:/my_path/to/my_dir
Example
I run the terminal in the path where my installation directory is located. In this case I'm talking about Play Framework. And I type:
export PATH=$PATH:/to/play20
It looks like nothing happens. In fact, when I type the command "play" (to execute the framework) I get:
-bash: play: command not found
Can someone please give me a decent step-by-step guide?
Execute the command “/to/play20/play help”. If this gives the expected output (help for the play command), then the executable is available, and the problem is in the shell path. If it does not give the expected output, then the executable is not working.
In the former case, ensure you are running the bash shell. (This is the default for recent versions of Mac OS X, but it may be changed for specific accounts.) To do this temporarily, execute the command “bash”. (When you want to exit the temporary shell, execute the command “exit”.) Then execute the export command again. (When the export command works, it changes the variable without displaying any output, so this is normal.) Check the spelling in the export command carefully.
In the latter case, execute “ls -ld /to/play20/play”. If you get a message that the file does not exist, then the executable is not installed correctly, and I cannot help you further. If the file is present, then it is not executable for some reason. This might be because you do not have permission to access it (especially permission to execute it, marked by “x” in certain places in the initial field of the ls output that may contain hyphens, “r”, “w”, and a few other letters) or that it is a symbolic link to a file that does not exist (indicated by an “l” in the first character of the ls output for the file). Lack of permission can be fixed by the chmod command, assuming you have appropriate permissions for changing permissions on the system. If the file is a symbolic link to another file, you may have a bad installation, or the target file may have permission issues (or be another symbolic link, and so on).

Resources