How to run 2-3 test cases in Appium

I am trying to automate 2-3 test cases after login.If I am trying to log out after logged in how I write log in code?? it giving me the error because I have already logged in the application.