def setUpClass(cls):
     TnsTest.setUpClass()
     Folder.clean(os.path.join(TEST_RUN_HOME, APP_NAME))
     Tns.create(app_name=APP_NAME, template=Template.HELLO_WORLD_NG.local_package)
     json = App.get_package_json(app_name=APP_NAME)
     cls.app_id = json['nativescript']['id']
     devices = Adb.get_ids(include_emulators=False)
     device_id = None
     for device in devices:
         device_id = device
     if device_id is not None:
         cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID,
                             version=Adb.get_version(device_id))
     Adb.uninstall(cls.app_id, device_id, assert_success=False)
 def setUpClass(cls):
     TnsTest.setUpClass()
     cls.emulator = DeviceManager.Emulator.ensure_available(Emulators.DEFAULT)
     Folder.clean(os.path.join(TEST_RUN_HOME, APP_NAME))
     Tns.create(app_name=APP_NAME, template=Template.HELLO_WORLD_NG.local_package, update=True)
     json = App.get_package_json(app_name=APP_NAME)
     cls.app_id = json['nativescript']['id']
     devices = Adb.get_ids(include_emulators=False)
     device_id = None
     for device in devices:
         device_id = device
     if device_id is not None:
         cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID,
                             version=Adb.get_version(device_id))
     Adb.uninstall(cls.app_id, device_id, assert_success=False)
     Tns.platform_add_android(APP_NAME, framework_path=Android.FRAMEWORK_PATH)