@@ -2719,6 +2719,29 @@ def delete_dist(self, args):
2719
2719
if dist .needs_build :
2720
2720
info ('No dist exists that matches your specifications, exiting without deleting.' )
2721
2721
shutil .rmtree (dist .dist_dir )
2722
+
2723
+ def sdk_tools (self , args ):
2724
+ '''Runs the android binary from the detected SDK directory, passing
2725
+ all arguments straight to it. This binary is used to install
2726
+ e.g. platform-tools for different API level targets. This is
2727
+ intended as a convenience function if android is not in your
2728
+ $PATH.
2729
+ '''
2730
+ parser = argparse .ArgumentParser (
2731
+ description = 'Run a binary from the /path/to/sdk/tools directory' )
2732
+ parser .add_argument ('tool' , help = ('The tool binary name to run' ))
2733
+ args , unknown = parser .parse_known_args (args )
2734
+
2735
+ ctx = self .ctx
2736
+ ctx .prepare_build_environment (user_sdk_dir = self .sdk_dir ,
2737
+ user_ndk_dir = self .ndk_dir ,
2738
+ user_android_api = self .android_api ,
2739
+ user_ndk_ver = self .ndk_version )
2740
+ android = sh .Command (join (ctx .sdk_dir , 'tools' , args .tool ))
2741
+ output = android (* unknown , _iter = True , _out_bufsize = 1 , _err_to_out = True )
2742
+ for line in output :
2743
+ sys .stdout .write (line )
2744
+ sys .stdout .flush ()
2722
2745
2723
2746
def adb (self , args ):
2724
2747
'''Runs the adb binary from the detected SDK directory, passing all
0 commit comments