Can't run xcodebuild as root - xcode

I'm running Xcode 6.4 and trying to build my project using the command line. This works fine without using sudo:
xcodebuild -workspace "project.xcworkspace" -scheme "project"
results in Build Succeeded. However:
sudo xcodebuild -workspace "project.xcworkspace" -scheme "project"
causes the operation to get stuck. I do have Xcode 7.0 Beta installed, is there anyway this could be the issue?

The issue was my schemes were not shared, which caused xcodebuild to get stuck waiting for input
https://github.com/travis-ci/travis-ci/issues/2949

Related

Xcode build succeeds however it does not downloads app on the simulator

Xcode build succeeds however it does not download app on the simulator through terminal.
I am using the below command in mac terminal to build my code, however, the build succeeds but the app does not get downloaded to my ios simulator as it does using the xcode application
xcrun xcodebuild -workspace MyApp.xcworkspace -scheme "Test App" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11,OS=13.2'
How can i successfully pull my code from Github and then successfully deploy on ios simulator with few lines?
After you build your content, run xcrun simctl install <UDID> <PATH> to install the app in the sim. Be sure you have booted it first as well ( which you can also use simctl for).

xcodebuild can't find cocoapods libraries

I have an xcode project (build from Unity) that uses cocoapods to install Firebase dependencies. It builds fine through the xcode GUI but not using the xcodebuild invocation that I use for automated builds:
xcodebuild -archivePath "$ARCHIVE_PATH" -project "$(pwd)/repo/quantum_unity/Build/$PLATFORM/Unity-iPhone.xcodeproj" -sdk iphoneos -allowProvisioningUpdates -scheme 'Unity-iPhone' -configuration 'Release Development' archive DEVELOPMENT_TEAM=$TEAMID
The build fails to find the FirebaseCore library in linking.
What needs to change in how I invoke xcodebuild so it's able to find the pods installed by cocoapods?
I'm using xcode version 9.4.1.
Use -workspace and the xcworkspace instead of the project.
After installing via CocoaPods and depending on them, always use the Xcode workspace instead of the project.

Travis CI build times out on "Collecting info for testtables..."

I am building an Xcode project using Travis CI. Whenever Travis build the project, everything succeeds up to this message:
Collecting info for testables...
After that, the build times out and errors.
My .travis.yml file looks like this:
language: objective-c
osx_image: xcode7.3
xcode_project: Project.xcodeproj
xcode_scheme: Project
xcode_sdk: iphonesimulator9.3
I am using Xcode 7.3.1 on the macOS Sierra beta.
It looks like you’re running into a known issue with xctool and Xcode 7.3, which is causing your build to fail. You could try replacing Xcode 7.3 with Xcode 7.2 in your .travis.yml, or you could replace xctool with xcodebuild using the sample script below in your .travis.yml.
script:
- xcodebuild build test -project {test-project} -scheme {test-scheme} | xcpretty
Either option should help you get around the error.

Jenkins&Xcode : Build crashes in ipad frequently

I'm currently generating an ios app with distribution profile. When I generate an ipa file from Xcode it works fine without any crashes when installed on an ipad but it crashes in most fields when generated from jenkins as a part CI process. Till now its working fine but the issue started while adding developed frameworks to the project. In jenkins I'm using below command line script for xcodebuild.
. xcodebuild -workspace ~/.jenkins/jobs/workspace/repo/Source/App/App.xcodeproj/project.xcworkspace -scheme App -configuration "release" -sdk iphoneos VALID_ARCHS="armv64 armv7 armv7s i386" archive PROVISIONING_PROFILE="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx" CODE_SIGN_IDENTITY="iPhone Distribution: company Limited" -archivePath ~/Desktop/../App.xcarchive
Unable to find out the exact issue for the crash.
I suggest you to check the environment variable of your jenkins node.. if they are overriding your build variables.
Before this can you provide more details.

Run installed application on iPad (device) from Mac Terminal

I build the application for iPad (from a Terminal) using:
xcodebuild ARCHS=armv7 ONLY_ACTIVE_ARCH=NO VALID_ARCHS=armv7 -scheme MyApp -sdk iphoneos build
Then I deploy it to my iPad using fruitstrap:
./fruitstrap -b Mobile/DerivedData/MyApp/Build/Products/Debug-iphoneos/MyApp.app/
At the next step I have a problem: I need to run the installed application from a Terminal to be able to run the nightly-iterations on Hudson CI.
Any ideas on how to do it?

Resources