# Test Your Command-Line Tool In Xcode

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

## Challenges

![Challenge: pass required arguments](https://cdn.hashnode.com/res/hashnode/image/upload/v1668809977740/LmzQFnFk3.png align="left")

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

1. Pass Arguments On Launch
2. Set a Custom Working Directory

## Pass Arguments On Launch

![Edit Scheme](https://cdn.hashnode.com/res/hashnode/image/upload/v1668809966641/L4Zqc-zOT.png align="left")

Open "Edit Scheme".

![Pass Arguments On Launch](https://cdn.hashnode.com/res/hashnode/image/upload/v1668809959969/3bnwB_iYL.png align="left")

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

![Positive test result for passing arguments on launch](https://cdn.hashnode.com/res/hashnode/image/upload/v1668809945264/zLtPphJna.png align="left")

## Set Custom Working Directory

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.

![Set custom working directory in scheme](https://cdn.hashnode.com/res/hashnode/image/upload/v1669087636194/hvkVzR_rr.png align="left")

![Positivite test result for custom working directory](https://cdn.hashnode.com/res/hashnode/image/upload/v1668809917915/K9zXC8VBk.png align="left")

## Demo

%[https://youtu.be/qeP4YgzWmjY]
