Is possible build an iPhone project from mac os x terminal and without an xcode project? - iphone

is possible build an iPhone project from Mac os x terminal and without an xcode project?
I'd like to make an iPhone static library without create and using xcode project and only with the terminal.
Thanks

For subsequent builds, after the first one, you can look at the command lines that Xcode executes in its Build window (there's a little command disclosure tab) and copy all those command lines into a script or suitable makefile template.

Related

Editing an Xcode project via Terminal command

I can open one of my Xcode project in Xcode and add Application supports iTunes file sharing=Yes to plist with Xcode and through Xcode directly, Now I was wandering if this work code be done completely via Terminal as well?
My Goal is type a command in Terminal that does the same work for plist just with Terminal and without opening Xcode program and doing it manually just with Terminal command. For example I have a random Xcode project saved on my Desktop, and since Xcode is accessible via Terminal, I want make this work.
As #Sweeper already answered you should got to the path of your .plist file and then write the following command:
vim Info.plist
This will open an editor which then you need to click on "i", then input the following line into the main tag:
<key>UIFileSharingEnabled</key><true/>
Then click "esc" then ":" then "w" then "q" and finally "Enter" and you are done.

Is it possible to compile a command line app written in Swift on macOS to run on Linux?

I'm new to Swift and am writing some simple command line apps. I'm using a Mac.
I know how to compile to a binary that will run on macOS but is it possible to take the same source code and compile the binary to run on Linux from a Mac? If so, any chance it could be compiled to Windows too?

Finder Synch Extension Waiting to Attach in XCode 7.0.1 OSX 10.10

I have written a Finder Synch extension with Swift and add to my project target in XCode 7.0.1. At first run, it works as normal but after several runs, it stall on Extension Waiting to Attach. If I open a Finder window, nothing happened and my class init never called.
Do you face any problem like this? Using Mac OSX 10.10.5 Yosemite with XCode 7.0.1.
This happened to me also, make sure your entitlements and certificates / signing are set correctly. Working with a non signed finder sync extension caused exactly the problems you described.
edit: one more thing, the optional relaunch (alt + right click on finder) also helps attach to the extension after it is launched.

Terminal: Swift Build command does not work

When I am using Swift Package builder in the OSX terminal, it does now work.
swift build
I get:
:0: error: no such file or directory: 'build'
REPL works and all the snapshots seem to be installed. Does anyone know the issue?
Yes. It helps. By Default command line tool will have nothing selected. Once you click a drop down will come and you can select the latest xCode. This will associate the XCode tool chain to the command line and you can use swift build, swift package init etc. You may not have to set the path also.
The solution is to download the development snapshot, not the release one - https://swift.org/builds/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a-osx.pkg
/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin should be appended before $PATH in your .bashrc:
PATH=/Applications/IBM/node/bin:/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH
A simpler solution is to install latest Xcode and change the command line tools to point to latest XCode Version. It can be done by going to Xcode > preferences > Locations > Command line tools.
Change it to Xcode (version number).

Applescript Xcode to clean, build and install on iPhone device

I'm trying to applescript XCode into building and launching on device. My script is as follows:
tell application "Xcode"
open "tmp:iphone:myproject:Project.xcodeproj"
tell project "Project"
clean
build
launch
end tell
end tell
My project consists of two targets, MainTarget and a SideTarget, the SideTarget is added as a direct dependency of MainTarget. I noticed that when my applescript runs on a pre-cleaned project (removing the build folder) only 65 files are compiled compared to when I press the "Build & Run" button in XCode 130 files are compiled.
The "launch" command in the script seems to be ignored when running the applescript - it simply does not launch on the device. The status in the bottom bar when the script is complete is "Build succeeded". What is the difference between "build" followed by "launch" compared to pressing the "Build & Run" button in the XCode top bar?
The project launches fine on device when building and running through XCode.
My main issue is that I can't get the applescript to launch on device. I do not know where things go wrong. Has anyone successfully scripted XCode to launch on device?
I've had this same problem. launch just does not work. You'll have to use debug instead.
Also, debug blocks forever, so invoke it with timeout and catch the timeout error and ignore it.
build and build and run are two separate commands within Xcode's GUI (v3.1.4 with build and go (run) and build and debug being the remainder). But the Dictionary for Xcode only shows build as being supported via Applescript. I would say both of these commands are the same as they are in the GUI, and in a perfect AS world we would see build and run in the Dictionary to make it more clear.
My question is whether launch is really building the app or just launching the previously built executable.