How can I use xcodebuild in command line? - objective-c

I'm a newbie to xcode.
I'm using xcode 4.3 with lion. I want to use xcodebuild in command line, but it report "no such file". I searched it with Finder, but no result.
What is this file's path? Does it exist in the Xcode.app?
Can I search files in a .app package?
Additional info:
When I typed "which xcodebuild", it return /usr/bin/xcodebuild. Enter this folder, and type xocdebuild, it still return Error:
Can't run /Applications/usr/bin/xcodebuild (no such file).

/usr/bin/xcodebuild only calls the xcodebuild command from the developer tools directory given by xcode-select. To find out the current developer tools directory as given by xcode-select run
xcode-select -print-path
I fixed the issue by changing that path executing
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Which is where my developer tools are. You should change /Applications/Xcode.app to wherever your Xcode application is.

The installer put mine in
/usr/bin/xcodebuild
You can also find it in the application bundle:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild

CHeck you have it installed. The command Line Tools for the latest XCodes are optional installs. You can install them from Xcode's preferences - Downloads Tab - Components.

Related

Running software build in MSYS2 MINGW32 shell

I'm trying to run a piece of software I built in MSYS2 MINGW32 shell. The software is 32bits (don't have time to port it to 64bits) and there is one statically linked executable. Here is how I setup the build environment:
Installed a fresh copy of MSYS2;
$ pacman -Syu
Installed the following packages: git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-SDL mingw-w64-i686-SDL_mixer mingw-w64-i686-zlib mingw-w64-i686-libpng mingw-w64-i686-make
Git checkout the repo
Run the build in CMake
Build runs fine and the exe is generated.
Now the problem starts: the executable can't run and displays an error message about missing DLLs. I copied the missing DLLs to the same folder of the executable, and them another error message pops up complaining about error 0xC000007B, which I tracked down to be missing dependencies. After a while I figured out that the problem was that some of the DLLs is missing a dependency itself. Copied this last dependency to the folder.
Now, the big question: I can run the exe perfectly fine in the MINGW32 shell but I can't run it neither in cmd.exe nor by double-clicking in Windows Explorer and this is a problem (I can't ship a software this way). Is there any way to produce a binary that is able to run from explorer and from cmd.exe? What is the cause of this problem? Can it be mitigated?
I solved my problem!
After a lot of research, I realized that nothing was wrong with my MSYS2 build/setup/dependencies. The real problem was that CMake hide one parameter for the linker: -mwindows. Actually, the CMake find_package routine from one of the libraries I'm using (SDL) added this parameter to the linker command line parameters.
Adding a -mconsole to the linker parameters (using add_link_options("-mconsole")) solved the problem. The CLI now works as expected.
Thank you all for your help.

How do I use GMake on Windows

I've downloaded the source files for the TBB libraries, with the intent to build them and link them into my CMake project. The readme file says "type 'gmake' in this directory to build and test."
My question is - how do I run gmake on a Windows machine.
The solution in this answer didn't work for me. This is what I get:
From the log I see that make unable to find Microsoft compiler cl.exe. To fix this, you must use one of the "Visual Studio command prompt"-s, those are cmd with environments targeted to command-line tools.
If you use MigGW by chance, the command should be
make compiler=gcc.
In this case, path environment variable should contain path to MigGW.

Monodevelop: "MSBuild process could not be started"

I just installed monodevelop on Arch Linux using pacman. I can compile with the mcs command, but I can not build in monodevelop. I am told "MSBuild process could not be started". The same error is given if I try building with mdtool on the command line.
Go to the project options of your project in monodevelop. At Build -> General, there is a new option called Use MSBuild engine (recommended for this project type). Uncheck this option.
Please refer to post Bug 33896 - Build fails if LANG is set to a UTF8 locale.
Basically you have to start monodevelop with something like LC_ALL=C monodevelop and you can use MSBuild.
Even better option is to enable non-utf8 locale for your region. Edit the content of /etc/locale.gen and un-comment your non-utf8 regional locale. Then run command
locale-gen
to regenerate locales and
locale -a
to verify that new locale is available. In my case (Slovenia) I then start monodevelop with
LC_ALL=sl_SI monodevelop
Or you can disable MSBuild as described in previous answer.

Compile issues with npm typescript#1.4.1 on Windows

I installed the TSC with NPM yesterday and when I download the last Typescript definitions from the repository with tsd#0.5.7 and I proceed to compile my code I got a lot of compile errors from the definitions. The only way that I have found to fix this kind of errors is going back to definitions for the typescript 1.3, Do you have an idea why this is happening?
Update 1
I installed the tsc for my mac (the installation mentioned before was in Windows) and when I run tsc --version I got different results, even if both of they say they are 1.4.1
Windows:
Mac
Probably your PATH environment variable is wrong, you can check that by executing echo %PATH% and you will probably see something like C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\; there before the roaming npm path.
You can change that by going to the Control Panel -> System & Security -> and on the left there is "Advanced System settings", click on It and a popup will open. Chose the tab "advanced" there and click the button "Environment variables", there you can change your path.
Reopen your command prompt (MSys on the look of your screenshot) or the change wont have any effect.
I hope the names are right, because I'm currently on a Dutch Windows version. If you have any problems please let me know :)
I rename the path of the 1.0 version to 1.0.1 and when I type tsc -v the result was 1.4.0.0
I changed from :
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0
To:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0.1
And it worked.
I installed the TSC with NPM yesterday and when I download the last Typescript definitions from the repository with tsd#0.5.7 and I proceed to compile my code I got a lot of compile errors from the definitions
Not possible if tsc is pointing to typescript#1.4.1. Run where tsc (windows) or which tsc (unix) or tsc --version. If it ain't the right version, then you have your answer. The following shows one error scenario:

How do you set up Gradle properly and create a new Gradle project for IntelliJ IDEA?

So, I downloaded Gradle but I don't know how to set it up correctly. After I unzipped the zip file, what do I do next? I want to use Gradle in IntelliJ IDEA. From a livestream I've seen I know that there's a settings.gradle and a build.gradle file in the project folder in IntelliJ.
Also, I've seen that they used the windows console.
First of all, how do I access gradle through the windows console and tell it to generate a new project for IntelliJ?
As you can see, I don't have any experience with Gradle. Unfortunately I can't really find out how to use it.
I want the IntelliJ project then to have LWJGL and Slick.
Additionally, I know what it says in the build.gradle file I've seen on the livestream (I only want to create my project with the same structure like theirs).
Can anybody give a detailed description of what to do to achieve all this?
Lets' say you unpacked gradle to d:\tools\gradle.
To add its bin directory it to the PATH in a console window, execute the following command:
set PATH=d:\tools\gradle\bin;%PATH%
The above prepends the bin path to the current value of the PATH environment variable. This will only change the path for this specific command window.
If you want to add it to the PATH globally, then go to your control panel and choose System, then Advanced parameters (it might be something a little bit different: I'm translating from my French version of Windows). Then in the Advanced system parameters tab, click the button Environment variables.... Find the Path environment variable in the list, and add the directory, separated from the others using a semicolon (;).
Note: you can also define a new environment variable called GRADLE_HOME:
set GRADLE_HOME=d:\tools\gradle
or globally, as explained above, and reference it inside the PATH variable:
set PATH=%GRADLE_HOME%\bin;%PATH%
Just intall homebrew.
Then you can just open the terminal and install easy like:
brew install gradle
Done! It's installed!
For test just type in your terminal:
gradle -v
And you'll have something like this:
------------------------------------------------------------
Gradle 2.7
------------------------------------------------------------
Build time: 2015-09-14 07:26:16 UTC
Build number: none
Revision: xxxxxxxxxxxxxxxxxxxxxxxxxx
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Mac OS X 10.11.1 x86_64
Then, open your IntelliJ and create a new gradle project as normal, just setting the gradle's path when necessary (normally in /usr/local/Cellar when installed with homebrew or /opt when installed other ways).
Good luck!
For linux Users,
User SDK Man to easily manage your gradle installation and path settings for development as well as gradle update
GET SDK MAN HERE
(for mac os users) Let's assume, you unpacked zip file into /Users/onuryilmaz/gradle-3.3 folder. Then open terminal and define a new environment variable called GRADLE_HOME:
export GRADLE_HOME=/Users/onuryilmaz/gradle-3.3
After that reference it inside the PATH variable:
export PATH=$PATH:$GRADLE_HOME/bin
just update the brew and install and set path that's all
brew update && brew install gradle
export PATH=$PATH:/opt/gradle/gradle-5.1.1/bin
https://gradle.org/install/