Xcodebuild test hangs indefinitely without error

Viewed 2010

Xcodebuild hangs indefinitely in Jenkins. But same setup works properly in local machine.

(Xcode 7.3.1, OS X 10.11.6)

Command executed (After clearing DerivedData & Clean)

xcodebuild -scheme APP_SCHEME -derivedDataPath ./DerivedData -sdk iphonesimulator -destination 'OS=9.3,name=iPhone 6' ARCHS=x86_64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO GCC_GENERATE_TEST_COVERAGE_FILES=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES test

Launches app in simulator and then Hangs indefinitely after following command without any error

touch APPSCHEME.xctest

1 Answers

xcodebuild hangs because it is not able to find & launch the appropriate simulator. Verify whether the below 2 commands gives the matching list of simulators and they are in available state. - xcrun simctl list - instruments -s devices

If not, then proceed on to do a clean uninstall of Xcode,install and then try running the command again

  1. Delete Xcode from Applications folder
  2. In ~/Library/Developer/ Delete Xcode and CoreSimulator folder
  3. sudo rm /Library/Preferences/com.apple.dt.Xcode.plist
  4. sudo rm -r ~/Library/Caches/com.apple.dt.Xcode
  5. sudo rm -r ~/Library/Application\ Support/Xcode/
  6. Clean Trash
  7. Restart Install Xcode ,Launch and Accept license Agreement and then Restart
Related