예제 #1
0
    def run(self, arguments, options):
        element = arguments[0]
        language = fb.currentLanguage()
        if element == "__default__":
            element = ("XCUIApplication()"
                       if language == lldb.eLanguageTypeSwift else
                       "(XCUIApplication *)[[XCUIApplication alloc] init]")

        # Evaluate object
        element_sbvalue = fb.evaluateExpressionValue("{}".format(element),
                                                     language=language)
        """:type: lldb.SBValue"""

        # Get pointer value, so it will be working in Swift and Objective-C
        element_pointer = int(element_sbvalue.GetValue(), 16)

        # Get XCElementSnapshot object
        snapshot = take_snapshot(element_pointer)

        # Print tree for snapshot element
        snapshot_object = XCElementSnapshot(snapshot, language=language)
        elements = snapshot_object.find_missing_identifiers(
            status_bar=options.status_bar)
        if elements is not None:
            print(
                elements.hierarchy_text(pointer=options.pointer,
                                        trait=options.trait,
                                        frame=options.frame))
        else:
            print("Couldn't found elements without identifier")
예제 #2
0
    def run(self, arguments, options):
        element = arguments[0]
        language = fb.currentLanguage()

        if element == "__default__":
            element = ("XCUIApplication()"
                       if language == lldb.eLanguageTypeSwift else
                       "(XCUIApplication *)[[XCUIApplication alloc] init]")

        if language == lldb.eLanguageTypeSwift:
            print(
                fb.evaluateExpressionValue(
                    "{}.debugDescription".format(element),
                    language=language).GetObjectDescription().replace(
                        "\\n", "\n").replace("\\'", "'").strip(' "\n\t'))
        else:
            print(
                fb.evaluateExpressionValue("[{} debugDescription]".format(
                    element)).GetObjectDescription())
예제 #3
0
    def run(self, arguments, options):
        element = arguments[0]
        language = fb.currentLanguage()
        if element == "__default__":
            element = ("XCUIApplication()"
                       if language == lldb.eLanguageTypeSwift else
                       "(XCUIApplication *)[[XCUIApplication alloc] init]")

        # Evaluate object
        element_sbvalue = fb.evaluateExpressionValue("{}".format(element),
                                                     language=language)
        """:type: lldb.SBValue"""

        # Get pointer value, so it will be working in Swift and Objective-C
        element_pointer = int(element_sbvalue.GetValue(), 16)

        # Get XCElementSnapshot object
        snapshot = take_snapshot(element_pointer)

        # Print details of snapshot element
        snapshot_object = XCElementSnapshot(snapshot, language=language)
        print(snapshot_object.detail_summary())