The answer: very carefully at first, but wholeheartedly if you commit.
If a guy with an idea for an app is asking you work with him, AND he already has a team of developers committed to the project, that is a good start. This indicates that the individuals on the dev team are getting more value working on this project than by doing something else.
As a result, you will want to do a few things before you decide to work with this guy and his dev team, or not.
1. Speak to each member of the dev team individually.
If the guy doesn't like or want you to speak to the dev team, that's a red flag and you can walk away in good conscience.
If you get to speak to each member of the dev team, learn how they came to become a part of the project and what they think (a) they are building, (b) why it is worth doing - both monetarily and otherwise, and (c) what they will do after it is built (are they thinking they will stay for the long term with a successful startup, or will they move on to the next project/contract, or do they have no idea? All very telling responses)
2. Negotiate your cash compensation separately from everything else.
Whether you get paid in 1 month, in installments, or after a future event ("we make a profit"), negotiate what the total amount will be first. Then, after that negotiate further to increase that amount based on concessions you are willing to make: you want more if you are paid in 2 years compared to if you are paid in 1 year. IF the guy won't give you a concrete date by which you are paid ("... I don't know when we will be profitable") or tells you a date but is unwilling to commit to it in writing, THEN you will want to require penalties with timelines. I.e., IF NOT profitable (and you are paid) after 1 year, then the amount you are promised increases by 20% + immediate $5,000 cash payment out of the guy's pocket at that time; IF NOT profitable after 2 years, then increase by 50% + immediate $15,000 cash payment out of guy's pocket at that time, etc.
3. After you finish negotiating cash, then negotiate equity and/or partnership.
Since the guy is unlikely to have incorporated at this point, there will be no corporate entity from which you can obtain legal rights to equity in the form of shares/stock or options. However, you need a legally binding document now. In order to prevent any funny tricks (not that they are necessarily being planned now, but they happen all the time when things change and the unexpected comes up - the guy has a baby, moves out of the country, comes into some money, etc., etc.) you need a legally binding written agreement now. Unless and until a corporation or LLC is filed/registered, you will want a partnership agreement that has the guy give you XX% of the app and anything related to the app (spin-off's, the code, etc.) now. If the guy is not willing to sign a legal agreement now, then you can again walk away in good conscience
4. If you get all of the above figured out and you know you can afford to work on this project full-time for the next 2-3 years without requiring any income at all, then and only then should you commit. However, once you commit, commit for hard. Commit for real. Make it happen, and don't look back.
Best of luck!