Test Your Command-Line Tool In Xcode

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸
Search for a command to run...

I am a Software Engineer working on open source and enterprise mobile SDKs for iOS and MacOS developers written in Swift. From 🇩🇪 and happily living in 🇺🇸
No comments yet. Be the first to comment.
WWDC26 kicked off on June 8, 2026. The information in this article reflects the information published by Apple on that date. There are 14 new frameworks. Name Description AccessoryAccess Manage

WWDC25 kicked off on June 9, 2025. The information in this article reflects the information published by Apple on that date. New Frameworks NameDescription AlarmKitSchedule prominent alarms and countdowns to help people manage their time. AVR...

WWDC25 is almost here, and I couldn’t be more excited! Whether you're attending the official events, community meetups, or just soaking in the energy around Cupertino, there’s no better time to connect, share ideas, and celebrate everything we love a...

In this blog post, I’ll share an observation and advice regarding the caching behavior of network responses by Apple’s APIs. If you are unfamiliar with caching of network responses then I recommend Apple’s article Accessing cached data that introduce...
WWDC24 kicked off on June 10, 2024. The information in this article reflects the information published by Apple on that date. New Frameworks NameDescription AccessorySetupKitUse AccessorySetupKit to discover accessories with Bluetooth or Wi-Fi...

Manual testing in the terminal is straightforward, but you might struggle with one of the following challenges when running your program from Xcode.

If your command-line tool defines mandatory arguments, you might feel stuck as no arguments are passed per default. Another challenge you might face is that you want to simulate that the program was started from a certain directory.
No worries. In this blog post, I will show you how to

Open "Edit Scheme".

You can specify the arguments passed on launch in the "Arguments" tab of the Run phase.

The $(BUILD_PRODUCTS_DIR) is used as the working directory per default. To change that, open "Edit Scheme". You can specify a custom working directory in the "Options" tab of the Run phase.

