Set simulator parameters in terminal that get used in test code

Hi there,

I found out last night all about setting appium desired capabilities using the terminal
e.g. $ appium --device-name ‘iPhone 6’

However, my test code contains desiredCapabilities code that is needed as a parameter for a new instance of iOSDriver. Therefore, I was simply wondering, how do you combine these 2 aspects in a test suite?

I keep getting deviceName not stipulated errors because they are not mentioned in my code, only in the appium server I create using the terminal.