android_gym/gym_android/envs/android_device.py
def _type_action(self, elem, token, emulator_id):
        """
        Edit an element with the token
        """
        coordx = int((elem.bounding_box.x1 + elem.bounding_box.x2) / 2)
        coordy = int((elem.bounding_box.y1 + elem.bounding_box.y2) / 2)

        command = "adb -s {2} shell input tap {0} {1}".format(coordx, coordy, emulator_id)
        os.system(command)

        time.sleep(0.4)

        command = "adb -s {0} shell input text {1}".format(emulator_id, token)
        os.system(command)
        time.sleep(0.4)

        self._fetch_new_view_hierarchy(emulator_id)

        Edit an element with the token
        
Edit an element with the token
Edit an element with the token
def _type_action(self, elem, token, emulator_id):
        coordx = int((elem.bounding_box.x1 + elem.bounding_box.x2) / 2)
        coordy = int((elem.bounding_box.y1 + elem.bounding_box.y2) / 2)
        command = "adb -s {2} shell input tap {0} {1}".format(coordx, coordy, emulator_id)
        os.system(command)
        time.sleep(0.4)
        command = "adb -s {0} shell input text {1}".format(emulator_id, token)
        os.system(command)
        time.sleep(0.4)
        self._fetch_new_view_hierarchy(emulator_id)
def _type_action ( self , elem , token , emulator_id ) : coordx = int ( ( elem . bounding_box . x1 + elem . bounding_box . x2 ) / 2 ) coordy = int ( ( elem . bounding_box . y1 + elem . bounding_box . y2 ) / 2 ) command = "adb -s {2} shell input tap {0} {1}" . format ( coordx , coordy , emulator_id ) os . system ( command ) time . sleep ( 0.4 ) command = "adb -s {0} shell input text {1}" . format ( emulator_id , token ) os . system ( command ) time . sleep ( 0.4 ) self . _fetch_new_view_hierarchy ( emulator_id )
Edit an element with the token
Edit an element with the token
"""
        Edit an element with the token
        """
self
elem
token
emulator_id