This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DeviceUID.h | |
#import <Foundation/Foundation.h> | |
@interface DeviceUID : NSObject | |
+ (NSString *)uid; | |
@end | |
*/ | |
// Device.m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CustomStringConvertible { | |
var description : String { | |
var description: String = "" | |
if self is AnyObject { | |
//description = "***** \(type(of: self)) - <\(unsafeAddressOf((self as! AnyObject)))>***** \n" | |
} else { | |
description = "***** \(type(of: self)) *****\n" | |
} | |
let selfMirror = Mirror(reflecting: self) | |
for child in selfMirror.children { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set /p Y=Enter adb.exe folder path: | |
cd %Y% | |
adb devices | |
pause | |
for %%X in ( | |
"com.android.browser" | |
"com.android.chrome" | |
"com.android.email" | |
"com.android.thememanager" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
extension NSApplication { | |
func relaunch(afterDelay seconds: TimeInterval = 0.5) -> Never { | |
let task = Process() | |
task.launchPath = "/bin/sh" | |
task.arguments = ["-c", "sleep \(seconds); open \"\(Bundle.main.bundlePath)\""] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSApplication (Relaunch) | |
- (void)relaunchAfterDelay:(float)seconds | |
{ | |
NSTask *task = [[[NSTask alloc] init] autorelease]; | |
NSMutableArray *args = [NSMutableArray array]; | |
[args addObject:@"-c"]; | |
[args addObject:[NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, [[NSBundle mainBundle] bundlePath]]]; | |
[task setLaunchPath:@"/bin/sh"]; | |
[task setArguments:args]; |