Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show finer progress when installing #515

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/ios-deploy/ios-deploy.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
bool _json_output = false;
NSMutableArray *_file_meta_info = nil;
int port = 0; // 0 means "dynamically assigned"
CFStringRef last_path = NULL;
ServiceConnRef dbgServiceConnection = NULL;
pid_t parent = 0;
// PID of child process running lldb
Expand Down Expand Up @@ -717,10 +716,13 @@ mach_error_t transfer_callback(CFDictionaryRef dict, int arg) {
CFNumberGetValue(CFDictionaryGetValue(dict, CFSTR("PercentComplete")), kCFNumberSInt32Type, &percent);

if (CFEqual(status, CFSTR("CopyingFile"))) {
static CFStringRef last_path = NULL;
static int last_overall_percent = -1;

CFStringRef path = CFDictionaryGetValue(dict, CFSTR("Path"));
int overall_percent = percent / 2;

if ((last_path == NULL || !CFEqual(path, last_path)) && !CFStringHasSuffix(path, CFSTR(".ipa"))) {
int overall_percent = percent / 2;
gabebear marked this conversation as resolved.
Show resolved Hide resolved
if ((last_path == NULL || !CFEqual(path, last_path) || last_overall_percent != overall_percent) && !CFStringHasSuffix(path, CFSTR(".ipa"))) {
NSLogOut(@"[%3d%%] Copying %@ to device", overall_percent, path);
NSLogJSON(@{@"Event": @"BundleCopy",
@"OverallPercent": @(overall_percent),
Expand All @@ -729,6 +731,8 @@ mach_error_t transfer_callback(CFDictionaryRef dict, int arg) {
});
}

last_overall_percent = overall_percent;

if (last_path != NULL) {
CFRelease(last_path);
}
Expand Down