See if this helps: Launching and stopping appium server programmtically
For the future you may want to list the command you are using and the steps you are taking as well as any errors you are getting. Without that you are relying on the collective guesswork of dogooders.