Android Studio Make Jar

task clearJar(type: Delete) {
    delete 'build/outputs/jar/something-release.jar'
}

task makeJar(type: Copy) {
    from('build/intermediates/bundles/release/')
    into('build/outputs/jar/')
    include('classes.jar')
    rename('classes.jar', 'something-release.jar')
}
makeJar.dependsOn(clearJar, build)

iOS Max Memory Budget

    iPad1: 127MB/256MB/49% (crash amount/total amount/percentage of total)
    iPad2: 275MB/512MB/53%
    iPad3: 645MB/1024MB/62%
    iPad4: 585MB/1024MB/57% (iOS 8.1)
    iPad Mini 1st Generation: 297MB/512MB/58%
    iPad Mini retina: 696MB/1024MB/68% (iOS 7.1)
    iPad Air: 697MB/1024MB/68%
    iPad Air 2: 1195MB/2048MB/58%
    iPod touch 4th gen: 130MB/256MB/51% (iOS 6.1.1)
    iPod touch 5th gen: 286MB/512MB/56% (iOS 7.0)
    iPhone4: 325MB/512MB/63%
    iPhone5: 645MB/1024MB/62%
    iPhone5S: 646MB/1024MB/63%
    iPhone6: 645MB/1024MB/62%
    iPhone6+: 645MB/1024MB/62%
    iPhone6s: 1396MB/2048MB/68% (iOS 9.2)
    iPhone6s+: 1195MB/2048MB/58%

Get iOS Memory Info

- (void)refreshMemoryInfo {
    uint64_t physicalMemorySize;
    uint64_t userMemorySize;
    
    int mib[2];
    size_t length;
    mib[0] = CTL_HW;
    
    mib[1] = HW_MEMSIZE;
    length = sizeof(int64_t);
    sysctl(mib, 2, &physicalMemorySize, &length, NULL, 0);
    
    mib[1] = HW_USERMEM;
    length = sizeof(int64_t);
    sysctl(mib, 2, &userMemorySize, &length, NULL, 0);
}

iOS 截图代码

- (UIImage*)snapshot
{
    UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0.0);
    [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO];
    UIImage *snap = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return snap;
}

– (BOOL)drawViewHierarchyInRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates是在iOS7.0才引入的,所有此方法只适合在iOS7.0及以上系统使用。

iOS Support Matrix

Alt none