Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
flavor.ios.iOSFlavor Class Reference
Inheritance diagram for flavor.ios.iOSFlavor:
flavor.default.DefaultFlavor

Public Member Functions

def __init__ (self, m, app_name)
 
def env (self)
 
def context (self)
 
def install (self)
 
def step (self, name, cmd, **kwargs)
 
def copy_file_to_device (self, host, device)
 
def copy_directory_contents_to_device (self, host, device)
 
def copy_directory_contents_to_host (self, device, host)
 
def remove_file_on_device (self, path)
 
def create_clean_device_dir (self, path)
 
def read_file_on_device (self, path, **kwargs)
 
- Public Member Functions inherited from flavor.default.DefaultFlavor
def __init__ (self, module, app_name)
 
def device_path_join (self, *args)
 
def copy_directory_contents_to_device (self, host_dir, device_dir)
 
def copy_directory_contents_to_host (self, device_dir, host_dir)
 
def copy_file_to_device (self, host_path, device_path)
 
def create_clean_device_dir (self, path)
 
def create_clean_host_dir (self, path)
 
def read_file_on_device (self, path, **kwargs)
 
def remove_file_on_device (self, path)
 
def install (self)
 
def cleanup_steps (self)
 
def step (self, name, cmd, **unused_kwargs)
 

Public Attributes

 device_dirs
 
- Public Attributes inherited from flavor.default.DefaultFlavor
 app_name
 
 module
 
 m
 
 device_dirs
 
 host_dirs
 

Detailed Description

Definition at line 12 of file ios.py.

Constructor & Destructor Documentation

◆ __init__()

def flavor.ios.iOSFlavor.__init__ (   self,
  m,
  app_name 
)

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 13 of file ios.py.

13 def __init__(self, m, app_name):
14 super(iOSFlavor, self).__init__(m, app_name)
15 self.device_dirs = default.DeviceDirs(
16 bin_dir='[unused]',
17 dm_dir='dm',
18 perf_data_dir='perf',
19 resource_dir='resources',
20 fonts_dir = 'NOT_SUPPORTED',
21 images_dir='images',
22 lotties_dir='lotties',
23 skp_dir='skps',
24 svg_dir='svgs',
25 tmp_dir='tmp',
26 texttraces_dir='')
27

Member Function Documentation

◆ context()

def flavor.ios.iOSFlavor.context (   self)

Definition at line 35 of file ios.py.

35 def context(self):
36 return self.m.context(env=self.env)
37

◆ copy_directory_contents_to_device()

def flavor.ios.iOSFlavor.copy_directory_contents_to_device (   self,
  host_dir,
  device_dir 
)
Like shutil.copytree(), but for copying to a connected device.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 145 of file ios.py.

145 def copy_directory_contents_to_device(self, host, device):
146 self._run_ios_script('push_if_needed', host, device)
147

◆ copy_directory_contents_to_host()

def flavor.ios.iOSFlavor.copy_directory_contents_to_host (   self,
  device_dir,
  host_dir 
)
Like shutil.copytree(), but for copying from a connected device.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 148 of file ios.py.

148 def copy_directory_contents_to_host(self, device, host):
149 self._run_ios_script('pull_if_needed', device, host)
150

◆ copy_file_to_device()

def flavor.ios.iOSFlavor.copy_file_to_device (   self,
  host_path,
  device_path 
)
Like shutil.copyfile, but for copying to a connected device.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 142 of file ios.py.

142 def copy_file_to_device(self, host, device):
143 self._run_ios_script('push_file', host, device)
144

◆ create_clean_device_dir()

def flavor.ios.iOSFlavor.create_clean_device_dir (   self,
  path 
)
Like shutil.rmtree() + os.makedirs(), but on a connected device.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 154 of file ios.py.

154 def create_clean_device_dir(self, path):
155 self._run_ios_script('rm', path)
156 self._run_ios_script('mkdir', path)
157

◆ env()

def flavor.ios.iOSFlavor.env (   self)

Definition at line 29 of file ios.py.

29 def env(self):
30 return {
31 'IOS_BUNDLE_ID': 'com.google.%s' % self.app_name,
32 'IOS_MOUNT_POINT': self.m.vars.workdir.join('mnt_iosdevice'),
33 }
34

◆ install()

def flavor.ios.iOSFlavor.install (   self)
Run device-specific installation steps.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 47 of file ios.py.

47 def install(self):
48 with self.context():
49 self._install()
50
static bool install(SkBitmap *bm, const SkImageInfo &info, const SkRasterHandleAllocator::Rec &rec)
Definition: SkCanvas.cpp:2856

◆ read_file_on_device()

def flavor.ios.iOSFlavor.read_file_on_device (   self,
  path,
**  kwargs 
)
Reads the specified file.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 158 of file ios.py.

158 def read_file_on_device(self, path, **kwargs):
159 with self.context():
160 full = self.m.path.start_dir.join(
161 'skia', 'platform_tools', 'ios', 'bin', 'ios_cat_file')
162 rv = self.m.run(self.m.step,
163 name = 'cat_file %s' % path,
164 cmd = [full, path],
165 stdout=self.m.raw_io.output(),
166 infra_step=True,
167 **kwargs)
168 return rv.stdout.decode('utf-8').rstrip() if rv and rv.stdout else None
Definition: run.py:1

◆ remove_file_on_device()

def flavor.ios.iOSFlavor.remove_file_on_device (   self,
  path 
)
Removes the specified file.

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 151 of file ios.py.

151 def remove_file_on_device(self, path):
152 self._run_ios_script('rm', path)
153

◆ step()

def flavor.ios.iOSFlavor.step (   self,
  name,
  cmd,
**  kwargs 
)

Reimplemented from flavor.default.DefaultFlavor.

Definition at line 118 of file ios.py.

118 def step(self, name, cmd, **kwargs):
119 app_name = cmd[0]
120 bundle_id = 'com.google.%s' % app_name
121 args = [bundle_id] + [str(ele) for ele in cmd[1:]]
122 success = False
123 with self.context():
124 try:
125 self.m.run(self.m.step, name, cmd=['idevicedebug', 'run'] + args)
126 success = True
127 finally:
128 if not success:
129 self.m.run(
130 self.m.step, '%s with full debug output' % name,
131 cmd=['python3', self.module.resource('ios_debug_cmd.py')] + args)
132
static int step(int x, SkScalar min, SkScalar max)
Definition: BlurTest.cpp:215
static SkString resource(SkPDFResourceType type, int index)

Member Data Documentation

◆ device_dirs

flavor.ios.iOSFlavor.device_dirs

Definition at line 15 of file ios.py.


The documentation for this class was generated from the following file: