I'm trying to build a working simulator build from xcodebuild. Compilation works but the final product won't run on the simulator when installed via WaxSim. If I build through the Xcode GUI then the final product installs without issue from WaxSim.
My question is, how can I see the exact xcodebuild command line that xcode is using to build a working simulator build. I just need to copy that into my shell script but it's proving elusive. I did a find in the build logs from xcode but there's no mention of xcodebuild there.
You can't. Xcode itself doesn't invoke xcodebuild during the build process. This post has more information on executing xcodebuild to build for the simulator.
Related
We have been using the answer provided here (How to upload an iOS app to the app store via command line) by Tomer Shiri to automate the uploading of our apps to the iTunes Connect using a script. This has been worked fine with Xcode 5.X but now we have installed Xcode 6 this fails when run.
We believe the script we have made is falling over on the line that contains the xcrun command with the error of:
users-mac-mini:~ user$ sh /Users/user/Desktop/Master\ Upload\ Script.sh
sh: create.sh: No such file or directory
error: Unknown application extension '.' - expected '.app' or '.ipa'
Does anyone know if the xcrun command has changed in Xcode 6? and if so what would be the equivalent command that incorporates any changes?
Thanks
James
EDIT: as a side thought I have seen a few comments around the internet that suggest that apple has confirmed that this is an undocumented tool. With that in mind, is anyone with decompiling\ disassembly skills able and willing to pull this apart and find a list of the CLI options for the xcode 6 version of the xcrun binary?
i would like to know how to develop iphone apps for terminal just like we do for android
by using the
android --target 1 --name someApp --package --com.someApp --activity main
command
how to do this for iphone apps
it should be like
iphone // then some options
or what is xcode or someother ide doing behind the scene ..??
If your question is "How do I develop from the terminal?", then, please, don't go there, but if you do:
The xcode project files are xml, they contain all information about your project, compile instructions, source files, resources, etc. You could create and manipulate these and use xcodebuild to compile your project.
If your question is 'How do I compile apps from the terminal?', then there are some valid reasons for doing so, automations, testing, etc. When you have installed Xcode, there are also some command line tools available, like xcodebuild. You can use these tools to build from the command line:
xcodebuild command line
Take a look at the xcoder ruby gem:
https://github.com/rayh/xcoder
How can I install a .app file in the simulator from the command line. Or do I need to install it from a .ipa file and how do I do that?
To run the app in the simulator you need a third party library like waxsim https://github.com/square/waxsim
You can setup their KIF library for acceptance tests
Then you can do a command line build and run it like this...
waxsim -f "ipad" "${MY_PATH}/MyApp.app" > $OUT_FILE 2>&1
Another option is to use the Frank libraries http://blog.thepete.net/blog/2012/06/24/writing-your-first-frank-test/ These are really easy to install and have a built in way to launch the simulator and run tests!
I have automated my iOS application using UIAutomation, To run this I launch iOS Instruments and run the script. If Same automation script I want to run to the device I use the below command which works as desired
instruments -w -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate myapp -e UIASCRIPT regression.js
But how do I run this from the command line to iOS Simulator ?
Please suggest.
Thanks
Sougata
If you don't supply the '-w' argument and build your app for the simulator sdk it should launch on the simulator.
In Xcode 6.0.1, running with the -w switch and passing in the symbolic name of the simulator appears to now be required (at least that's the only way I got it to work, and I've had others verify and point me to this solution).
See my answer from another post that has an explicit example.
You can also find a bash shell script that will handle invocation for you, automating the resolution of UDID and GUIDs in your simulator app paths.
In Xcode, I can use CMD-R to run (or CMD-Y to debug), and my app will compile, install on the phone & start-up. (I've already prepped my phone & Xcode so this part works as expected.)
What I'd LIKE to do is type CMD-<something else> and have my program compile & install on the phone, but NOT start-up.
I realize that I can just CMD-B to build, then go through some rigamarole to deploy, but I'm hoping one of you smart-folk can tell me the lazy-man's shortcut for all of this.
Hey Olie, I haven't tried this because I don't have an iPhone to deploy to at the moment, but this /should/ work:
You can create a script which runs xcodebuild in your current project directory and give it the install target. Assuming you're going to want to debug at sometime, use the Debug configuration, otherwise use release. Then bind the script to some command key in the Xcode preferences and you should be on your way. To launch xcodebuild with debug you would do something like:
xcodebuild install -configuration Debug
If you have more than one target in your project you will have to specify that to xcodebuild as well:
xcodebuild install -target iPhoneApp -configuration Debug
You could also create a configuration specific to this scenario in your projects and pass that to xcodebuild and you should be able to script this in your favorite supported language (i.e., AppleScript, python, ruby, etc.).
HTH
I had the same question.
I ended up using the XCode Organizer. Select your current device. Summary Tab. "+" Applications..then select the one you just built (under /build/[debug|release]-iphoneos/.app
This does the install very easily.
Have you looked into using Automator? Here's a good write up on how to automate XCode to build and what not.
To build (exact flags documented under "man xcodebuild", install xcode's command line tools): xcodebuild build -sdk iphoneos6.0 workspace/project, targets, configs and/or scheme flags
To install (grab from github here then simply make and run): path/to/fruitstrap --id device-uuid-to-install-on --bundle path/to/ios.app