import uiautomator2 as u2 d = u2.connect() d.set_input_ime(True)