It’s important to bring both. Have enough cash to last you at least a few days, then you can find an ATM. Debit cards are better than credit cards in China, as most places don’t accept credit cards.