Example #1
0
        self.proxy('runLoop=false;')

        # Kill Instruments if it's not being nice
        start_time = time()
        while (time() - start_time < 15 and self.instruments_process.poll() == None):
            sleep(1)
        numRetry = 10
        while (numRetry >= 0 and self.instruments_process.poll() is None):
            self.instruments_process.terminate()
            sleep(1)
            numRetry = numRetry - 1
        if self.instruments_process.poll() is None:
            raise Exception('instruments process did not finish')

        # Kill iOS Simulator
        call("""/usr/bin/osascript -e 'tell app "iPhone Simulator" to quit'""", shell=True)
        sleep(2) # give it some extra time
        self.simulator_is_running = False

if __name__ == '__main__':
    from interpreter import launch
    import argparse

    parser = argparse.ArgumentParser(description='An interpreter for sending raw UIAutomation javascript commands to the simulator or a device')
    parser.add_argument('app', type=str, help='path to simulators .app file or the bundle_id of the desired target on device')
    parser.add_argument('-v', dest='verbose', action="store_true", default=False, help='verbose mode')
    parser.add_argument('-U', '--UDID', type=str, help='unique device identifier of the SUT')

    args = parser.parse_args()
    launch(args.app, args.UDID, args.verbose)
Example #2
0
        # Tell Instruments to shut down (nicely)
        self.proxy('runLoop=false;')

        # Kill Instruments if it's not being nice
        start_time = time()
        while (time() - start_time < 15 and self.instruments_process.poll() == None):
            sleep(1)
        numRetry = 10
        while (--numRetry >= 0 and self.instruments_process.poll() is None):
            self.instruments_process.terminate()
            sleep(1)
        if self.instruments_process.poll() is None:
            raise Error('instruments process did not finish')

        # Kill iOS Simulator
        call("""/usr/bin/osascript -e 'tell app "iPhone Simulator" to quit'""", shell=True)
        sleep(2) # give it some extra time
        self.simulator_is_running = False

if __name__ == '__main__':
    from interpreter import launch
    import argparse

    parser = argparse.ArgumentParser(description='An interpreter for sending raw UIAutomation javascript commands to the simulator or a device')
    parser.add_argument('app', type=str, help='path to simulators .app file or the bundle_id of the desired target on device')
    parser.add_argument('-U', '--UDID', type=str, help='unique device identifier of the SUT')

    args = parser.parse_args()
    launch(args.app, args.UDID)
Example #3
0
        sleep(2)  # give it some extra time
        self.simulator_is_running = False


if __name__ == '__main__':
    from interpreter import launch
    import argparse

    parser = argparse.ArgumentParser(
        description=
        'An interpreter for sending raw UIAutomation javascript commands to the simulator or a device'
    )
    parser.add_argument(
        'app',
        type=str,
        help=
        'path to simulators .app file or the bundle_id of the desired target on device'
    )
    parser.add_argument('-v',
                        dest='verbose',
                        action="store_true",
                        default=False,
                        help='verbose mode')
    parser.add_argument('-U',
                        '--UDID',
                        type=str,
                        help='unique device identifier of the SUT')

    args = parser.parse_args()
    launch(args.app, args.UDID, args.verbose)
Example #4
0
        self.proxy('runLoop=false;')

        # Kill Instruments if it's not being nice
        start_time = time()
        while (time() - start_time < 15
               and self.instruments_process.poll() == None):
            pass
        if self.instruments_process.poll() is None:
            self.instruments_process.terminate()

        # Kill iOS Simulator
        call("""/usr/bin/osascript -e 'tell app "iPhone Simulator" to quit'""",
             shell=True)
        self.simulator_is_running = False


if __name__ == '__main__':
    from interpreter import launch
    import sys
    if len(sys.argv) == 2:
        app = sys.argv[1]
        launch(app)
    else:
        print """
  Appium - iOS App Automation 
       
  Usage: 
    When run as a script, include the absolute path to an app:
    $ python appium.py ~/somethingawesome.app
  """
Example #5
0
            raise Error('instruments process did not finish')

        # Kill iOS Simulator
        call("""/usr/bin/osascript -e 'tell app "iPhone Simulator" to quit'""",
             shell=True)
        sleep(2)  # give it some extra time
        self.simulator_is_running = False


if __name__ == '__main__':
    from interpreter import launch
    import argparse

    parser = argparse.ArgumentParser(
        description=
        'An interpreter for sending raw UIAutomation javascript commands to the simulator or a device'
    )
    parser.add_argument(
        'app',
        type=str,
        help=
        'path to simulators .app file or the bundle_id of the desired target on device'
    )
    parser.add_argument('-U',
                        '--UDID',
                        type=str,
                        help='unique device identifier of the SUT')

    args = parser.parse_args()
    launch(args.app, args.UDID)