Xcode: TEST vs DEBUG preprocessor macros

Preprocessor macros will not work, you need to check the environment at runtime. Objective-c static BOOL isRunningTests(void) { NSDictionary* environment = [[NSProcessInfo processInfo] environment]; return (environment[@”XCTestConfigurationFilePath”] != nil); } Swift var unitTesting : Bool { return ProcessInfo.processInfo.environment[“XCTestConfigurationFilePath”] != nil } (Updated for Xcode 11)

Added pod files and pushed. How to undo? how to use gitignore in Xcode & github?

That’s correct, you need to add the Pods directory to your .gitignore 1) Remove your files from your github repository: git rm -r Pods/ and don’t forget to commit and push 2) Create a gitignore file: Open terminal and go through your project folder where the .git folder is located Type touch .gitignore Type echo … Read more

Can I delete data from the iOS DeviceSupport directory?

The ~/Library/Developer/Xcode/iOS DeviceSupport folder is basically only needed to symbolicate crash logs. You could completely purge the entire folder. Of course the next time you connect one of your devices, Xcode would redownload the symbol data from the device. I clean out that folder once a year or so by deleting folders for versions of … Read more

Import IntelliJ key bindings to Xcode

I just created a repository with part of IntelliJ bindings migrated to an xCode template(including the custom duplicate line). Feel free to give it a look, try it and keep improving it. Sadly the only way we can achieve this is doing it manually. https://github.com/FrangSierra/Xcode-IntelliJ-Keybinds There is also another repository with the color theme of … Read more

Error at launch app

There could be some corrupt files in your build folder. Try running Clean (⌘+⇧+K) and Clean build folder… ( ⌘+⇧+⌥+K ) and rebuild your application.