Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4346b331b7 | ||
|
baa524eda5 | ||
|
66ca97ef12 | ||
|
e8bbb96de2 | ||
|
928635e44f | ||
|
99efb11c3d | ||
|
b4b17cc722 | ||
|
2ed9a17914 | ||
|
feb51d582a | ||
|
d7cccae1ad | ||
|
9871c759e0 | ||
|
956e925f97 | ||
|
c769f3cf58 | ||
|
440454fc5a | ||
|
c4cd7b4a55 | ||
|
d688e29975 | ||
|
7b07c2e28d |
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,3 +2,5 @@ build/*
|
||||
node_modules/*
|
||||
/.DS_Store
|
||||
*~
|
||||
src/scripts/lldb.pyc
|
||||
src/ios-deploy/lldb.py.h
|
||||
|
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7E8E3A821C45D4CE0017F6C1"
|
||||
BuildableName = "ios-deploy-tests.xctest"
|
||||
BlueprintName = "ios-deploy-tests"
|
||||
ReferencedContainer = "container:ios-deploy.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ios-deploy",
|
||||
"version": "1.8.4",
|
||||
"version": "1.9.0",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
@ -18,7 +18,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "./src/scripts/check_reqs.js && xcodebuild",
|
||||
"test": "npm run pycompile && npm run jshint && xcodebuild -scheme ios-deploy-lib && xcodebuild test -scheme ios-deploy-tests",
|
||||
"test": "npm run pycompile && npm run jshint && xcodebuild -target ios-deploy-lib && xcodebuild test -scheme ios-deploy-tests",
|
||||
"jshint": "node node_modules/jshint/bin/jshint src/scripts/*.js",
|
||||
"pycompile": "python -m py_compile src/scripts/*.py"
|
||||
},
|
||||
|
@ -76,8 +76,8 @@ int AMDeviceGetInterfaceType(struct am_device *device);
|
||||
bool found_device = false, debug = false, verbose = false, unbuffered = false, nostart = false, detect_only = false, install = true, uninstall = false, no_wifi = false;
|
||||
bool command_only = false;
|
||||
char *command = NULL;
|
||||
char *target_filename = NULL;
|
||||
char *upload_pathname = NULL;
|
||||
char const*target_filename = NULL;
|
||||
char const*upload_pathname = NULL;
|
||||
char *bundle_id = NULL;
|
||||
bool interactive = true;
|
||||
bool justlaunch = false;
|
||||
@ -185,23 +185,14 @@ Boolean path_exists(CFTypeRef path) {
|
||||
|
||||
CFStringRef find_path(CFStringRef rootPath, CFStringRef namePattern, CFStringRef expression) {
|
||||
FILE *fpipe = NULL;
|
||||
CFStringRef quotedRootPath = rootPath;
|
||||
CFStringRef cf_command;
|
||||
CFRange slashLocation;
|
||||
|
||||
if (CFStringGetCharacterAtIndex(rootPath, 0) != '`') {
|
||||
quotedRootPath = CFStringCreateWithFormat(NULL, NULL, CFSTR("'%@'"), rootPath);
|
||||
}
|
||||
|
||||
slashLocation = CFStringFind(namePattern, CFSTR("/"), 0);
|
||||
if (slashLocation.location == kCFNotFound) {
|
||||
cf_command = CFStringCreateWithFormat(NULL, NULL, CFSTR("find %@ -name '%@' %@ 2>/dev/null | sort | tail -n 1"), quotedRootPath, namePattern, expression);
|
||||
cf_command = CFStringCreateWithFormat(NULL, NULL, CFSTR("find %@ -name '%@' %@ 2>/dev/null | sort | tail -n 1"), rootPath, namePattern, expression);
|
||||
} else {
|
||||
cf_command = CFStringCreateWithFormat(NULL, NULL, CFSTR("find %@ -path '%@' %@ 2>/dev/null | sort | tail -n 1"), quotedRootPath, namePattern, expression);
|
||||
}
|
||||
|
||||
if (quotedRootPath != rootPath) {
|
||||
CFRelease(quotedRootPath);
|
||||
cf_command = CFStringCreateWithFormat(NULL, NULL, CFSTR("find %@ -path '%@' %@ 2>/dev/null | sort | tail -n 1"), rootPath, namePattern, expression);
|
||||
}
|
||||
|
||||
char command[1024] = { '\0' };
|
||||
@ -331,6 +322,13 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
||||
GET_FRIENDLY_MODEL_NAME(model, "P102AP", "iPad 4 (GSM)")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "P103AP", "iPad 4 (CDMA)")
|
||||
|
||||
// iPad Pro
|
||||
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J98aAP", "iPad Pro (12.9\")")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J98aAP", "iPad Pro (12.9\")")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J127AP", "iPad Pro (9.7\")")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J128AP", "iPad Pro (9.7\")")
|
||||
|
||||
// iPad Mini
|
||||
|
||||
GET_FRIENDLY_MODEL_NAME(model, "P105AP", "iPad mini")
|
||||
@ -342,6 +340,7 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
||||
GET_FRIENDLY_MODEL_NAME(model, "K66AP", "Apple TV 2G")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J33AP", "Apple TV 3G")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J33IAP", "Apple TV 3.1G")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "J42dAP", "Apple TV 4G")
|
||||
|
||||
// iPhone
|
||||
|
||||
@ -360,11 +359,18 @@ const CFStringRef get_device_hardware_name(const AMDeviceRef device) {
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N53AP", "iPhone 5s (Global/CDMA)")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N61AP", "iPhone 6 (GSM)")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N56AP", "iPhone 6 Plus")
|
||||
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N71mAP", "iPhone 6s")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N71AP", "iPhone 6s")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N66AP", "iPhone 6s Plus")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N66mAP", "iPhone 6s Plus")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N69AP", "iPhone SE")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "N69uAP", "iPhone SE")
|
||||
|
||||
GET_FRIENDLY_MODEL_NAME(model, "D10AP", "iPhone 7")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "D101AP", "iPhone 7")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "D11AP", "iPhone 7 Plus")
|
||||
GET_FRIENDLY_MODEL_NAME(model, "D111AP", "iPhone 7 Plus")
|
||||
|
||||
|
||||
return model;
|
||||
}
|
||||
@ -445,25 +451,39 @@ CFMutableArrayRef get_device_product_version_parts(AMDeviceRef device) {
|
||||
CFStringRef copy_device_support_path(AMDeviceRef device) {
|
||||
CFStringRef version = NULL;
|
||||
CFStringRef build = AMDeviceCopyValue(device, 0, CFSTR("BuildVersion"));
|
||||
CFStringRef deviceClass = AMDeviceCopyValue(device, 0, CFSTR("DeviceClass"));
|
||||
CFStringRef path = NULL;
|
||||
CFMutableArrayRef version_parts = get_device_product_version_parts(device);
|
||||
|
||||
NSLogVerbose(@"Device Class: %@", deviceClass);
|
||||
NSLogVerbose(@"build: %@", build);
|
||||
|
||||
CFStringRef deviceClassPath_platform;
|
||||
CFStringRef deviceClassPath_alt;
|
||||
if (CFStringCompare(CFSTR("AppleTV"), deviceClass, 0) == kCFCompareEqualTo) {
|
||||
deviceClassPath_platform = CFSTR("Platforms/AppleTVOS.platform/DeviceSupport");
|
||||
deviceClassPath_alt = CFSTR("tvOS\\ DeviceSupport");
|
||||
} else {
|
||||
deviceClassPath_platform = CFSTR("Platforms/iPhoneOS.platform/DeviceSupport");
|
||||
deviceClassPath_alt = CFSTR("iOS\\ DeviceSupport");
|
||||
}
|
||||
while (CFArrayGetCount(version_parts) > 0) {
|
||||
version = CFStringCreateByCombiningStrings(NULL, version_parts, CFSTR("."));
|
||||
NSLogVerbose(@"version: %@", version);
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("iOS DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)"), version, build));
|
||||
path = copy_xcode_path_for(deviceClassPath_alt, CFStringCreateWithFormat(NULL, NULL, CFSTR("%@\\ \\(%@\\)"), version, build));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)"), version, build));
|
||||
path = copy_xcode_path_for(deviceClassPath_platform, CFStringCreateWithFormat(NULL, NULL, CFSTR("%@\\ \\(%@\\)"), version, build));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (*)"), version));
|
||||
path = copy_xcode_path_for(deviceClassPath_platform, CFStringCreateWithFormat(NULL, NULL, CFSTR("%@\\ \\(*\\)"), version));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), version);
|
||||
path = copy_xcode_path_for(deviceClassPath_platform, version);
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport/Latest"), CFSTR(""));
|
||||
path = copy_xcode_path_for(CFStringCreateWithFormat(NULL, NULL, CFSTR("%@%@"), deviceClassPath_platform, CFSTR("/Latest")), CFSTR(""));
|
||||
}
|
||||
CFRelease(version);
|
||||
if (path != NULL) {
|
||||
@ -474,7 +494,7 @@ CFStringRef copy_device_support_path(AMDeviceRef device) {
|
||||
|
||||
CFRelease(version_parts);
|
||||
CFRelease(build);
|
||||
|
||||
CFRelease(deviceClass);
|
||||
if (path == NULL)
|
||||
on_error(@"Unable to locate DeviceSupport directory. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!");
|
||||
|
||||
@ -484,25 +504,40 @@ CFStringRef copy_device_support_path(AMDeviceRef device) {
|
||||
CFStringRef copy_developer_disk_image_path(AMDeviceRef device) {
|
||||
CFStringRef version = NULL;
|
||||
CFStringRef build = AMDeviceCopyValue(device, 0, CFSTR("BuildVersion"));
|
||||
CFStringRef deviceClass = AMDeviceCopyValue(device, 0, CFSTR("DeviceClass"));
|
||||
CFStringRef path = NULL;
|
||||
CFMutableArrayRef version_parts = get_device_product_version_parts(device);
|
||||
|
||||
NSLogVerbose(@"Device Class: %@", deviceClass);
|
||||
NSLogVerbose(@"build: %@", build);
|
||||
CFStringRef deviceClassPath_platform;
|
||||
CFStringRef deviceClassPath_alt;
|
||||
if (CFStringCompare(CFSTR("AppleTV"), deviceClass, 0) == kCFCompareEqualTo) {
|
||||
deviceClassPath_platform = CFSTR("Platforms/AppleTVOS.platform/DeviceSupport");
|
||||
deviceClassPath_alt = CFSTR("tvOS\\ DeviceSupport");
|
||||
} else {
|
||||
deviceClassPath_platform = CFSTR("Platforms/iPhoneOS.platform/DeviceSupport");
|
||||
deviceClassPath_alt = CFSTR("iOS\\ DeviceSupport");
|
||||
}
|
||||
// path = getPathForTVOS(device);
|
||||
while (CFArrayGetCount(version_parts) > 0) {
|
||||
version = CFStringCreateByCombiningStrings(NULL, version_parts, CFSTR("."));
|
||||
NSLogVerbose(@"version: %@", version);
|
||||
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("iOS DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)/DeveloperDiskImage.dmg"), version, build));
|
||||
path = copy_xcode_path_for(CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/%@\\ \\(%@\\)"), deviceClassPath_alt, version, build), CFSTR("DeveloperDiskImage.dmg"));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)/DeveloperDiskImage.dmg"), version, build));
|
||||
path = copy_xcode_path_for(deviceClassPath_platform, CFStringCreateWithFormat(NULL, NULL, CFSTR("%@ (%@)/DeveloperDiskImage.dmg"), version, build));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("*/%@ (*)/DeveloperDiskImage.dmg"), version));
|
||||
path = copy_xcode_path_for(CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/%@\\ \\(*\\)"), deviceClassPath_platform, version), CFSTR("DeveloperDiskImage.dmg"));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport"), CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/DeveloperDiskImage.dmg"), version));
|
||||
path = copy_xcode_path_for(deviceClassPath_platform, CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/DeveloperDiskImage.dmg"), version));
|
||||
}
|
||||
if (path == NULL) {
|
||||
path = copy_xcode_path_for(CFSTR("Platforms/iPhoneOS.platform/DeviceSupport/Latest"), CFSTR("DeveloperDiskImage.dmg"));
|
||||
path = copy_xcode_path_for(CFStringCreateWithFormat(NULL, NULL, CFSTR("%@/Latest"), deviceClassPath_platform), CFSTR("/DeveloperDiskImage.dmg"));
|
||||
}
|
||||
CFRelease(version);
|
||||
if (path != NULL) {
|
||||
@ -513,6 +548,7 @@ CFStringRef copy_developer_disk_image_path(AMDeviceRef device) {
|
||||
|
||||
CFRelease(version_parts);
|
||||
CFRelease(build);
|
||||
CFRelease(deviceClass);
|
||||
if (path == NULL)
|
||||
on_error(@"Unable to locate DeveloperDiskImage.dmg. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!");
|
||||
|
||||
@ -1192,9 +1228,9 @@ service_conn_t start_house_arrest_service(AMDeviceRef device) {
|
||||
return houseFd;
|
||||
}
|
||||
|
||||
char* get_filename_from_path(char* path)
|
||||
char const* get_filename_from_path(char const* path)
|
||||
{
|
||||
char *ptr = path + strlen(path);
|
||||
char const*ptr = path + strlen(path);
|
||||
while (ptr > path)
|
||||
{
|
||||
if (*ptr == '/')
|
||||
@ -1208,7 +1244,7 @@ char* get_filename_from_path(char* path)
|
||||
return ptr+1;
|
||||
}
|
||||
|
||||
void* read_file_to_memory(char * path, size_t* file_size)
|
||||
void* read_file_to_memory(char const * path, size_t* file_size)
|
||||
{
|
||||
struct stat buf;
|
||||
int err = stat(path, &buf);
|
||||
@ -1371,10 +1407,12 @@ void download_tree(AMDeviceRef device)
|
||||
if (afc_conn_p) AFCConnectionClose(afc_conn_p);
|
||||
}
|
||||
|
||||
void upload_file(AMDeviceRef device) {
|
||||
service_conn_t houseFd = start_house_arrest_service(device);
|
||||
void upload_dir(AMDeviceRef device, afc_connection* afc_conn_p, NSString* source, NSString* destination);
|
||||
void upload_single_file(AMDeviceRef device, afc_connection* afc_conn_p, NSString* sourcePath, NSString* destinationPath);
|
||||
|
||||
afc_file_ref file_ref;
|
||||
void upload_file(AMDeviceRef device)
|
||||
{
|
||||
service_conn_t houseFd = start_house_arrest_service(device);
|
||||
|
||||
afc_connection afc_conn;
|
||||
afc_connection* afc_conn_p = &afc_conn;
|
||||
@ -1387,44 +1425,82 @@ void upload_file(AMDeviceRef device) {
|
||||
target_filename = get_filename_from_path(upload_pathname);
|
||||
}
|
||||
|
||||
NSString* sourcePath = [NSString stringWithUTF8String: upload_pathname];
|
||||
NSString* destinationPath = [NSString stringWithUTF8String: target_filename];
|
||||
|
||||
BOOL isDir;
|
||||
bool exists = [[NSFileManager defaultManager] fileExistsAtPath: sourcePath isDirectory: &isDir];
|
||||
if (!exists)
|
||||
{
|
||||
on_error(@"Could not find file: %s", upload_pathname);
|
||||
}
|
||||
else if (isDir)
|
||||
{
|
||||
upload_dir(device, afc_conn_p, sourcePath, destinationPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
upload_single_file(device, afc_conn_p, sourcePath, destinationPath);
|
||||
}
|
||||
assert(AFCConnectionClose(afc_conn_p) == 0);
|
||||
}
|
||||
|
||||
void upload_single_file(AMDeviceRef device, afc_connection* afc_conn_p, NSString* sourcePath, NSString* destinationPath) {
|
||||
|
||||
afc_file_ref file_ref;
|
||||
|
||||
// read_dir(houseFd, NULL, "/", NULL);
|
||||
|
||||
size_t file_size;
|
||||
void* file_content = read_file_to_memory(upload_pathname, &file_size);
|
||||
void* file_content = read_file_to_memory([sourcePath fileSystemRepresentation], &file_size);
|
||||
|
||||
if (!file_content)
|
||||
{
|
||||
on_error(@"Could not open file: %@", [NSString stringWithUTF8String:upload_pathname]);
|
||||
on_error(@"Could not open file: %@", sourcePath);
|
||||
}
|
||||
|
||||
// Make sure the directory was created
|
||||
{
|
||||
char *dirpath = strdup(target_filename);
|
||||
char *c = dirpath, *lastSlash = dirpath;
|
||||
while(*c) {
|
||||
if(*c == '/') {
|
||||
lastSlash = c;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
*lastSlash = '\0';
|
||||
check_error(AFCDirectoryCreate(afc_conn_p, dirpath));
|
||||
NSString *dirpath = [destinationPath stringByDeletingLastPathComponent];
|
||||
check_error(AFCDirectoryCreate(afc_conn_p, [dirpath fileSystemRepresentation]));
|
||||
}
|
||||
|
||||
|
||||
int ret = AFCFileRefOpen(afc_conn_p, target_filename, 3, &file_ref);
|
||||
int ret = AFCFileRefOpen(afc_conn_p, [destinationPath fileSystemRepresentation], 3, &file_ref);
|
||||
if (ret == 0x000a) {
|
||||
on_error(@"Cannot write to %@. Permission error.", [NSString stringWithUTF8String:target_filename]);
|
||||
on_error(@"Cannot write to %@. Permission error.", destinationPath);
|
||||
}
|
||||
if (ret == 0x0009) {
|
||||
on_error(@"Target %@ is a directory.", [NSString stringWithUTF8String:target_filename]);
|
||||
on_error(@"Target %@ is a directory.", destinationPath);
|
||||
}
|
||||
assert(ret == 0);
|
||||
assert(AFCFileRefWrite(afc_conn_p, file_ref, file_content, file_size) == 0);
|
||||
assert(AFCFileRefClose(afc_conn_p, file_ref) == 0);
|
||||
assert(AFCConnectionClose(afc_conn_p) == 0);
|
||||
|
||||
free(file_content);
|
||||
}
|
||||
|
||||
void upload_dir(AMDeviceRef device, afc_connection* afc_conn_p, NSString* source, NSString* destination)
|
||||
{
|
||||
check_error(AFCDirectoryCreate(afc_conn_p, [destination fileSystemRepresentation]));
|
||||
destination = [destination copy];
|
||||
for (NSString* item in [[NSFileManager defaultManager] contentsOfDirectoryAtPath: source error: nil])
|
||||
{
|
||||
NSString* sourcePath = [source stringByAppendingPathComponent: item];
|
||||
NSString* destinationPath = [destination stringByAppendingPathComponent: item];
|
||||
BOOL isDir;
|
||||
[[NSFileManager defaultManager] fileExistsAtPath: sourcePath isDirectory: &isDir];
|
||||
if (isDir)
|
||||
{
|
||||
upload_dir(device, afc_conn_p, sourcePath, destinationPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
upload_single_file(device, afc_conn_p, sourcePath, destinationPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void make_directory(AMDeviceRef device) {
|
||||
service_conn_t houseFd = start_house_arrest_service(device);
|
||||
|
||||
|
@ -1,86 +0,0 @@
|
||||
"# AUTO-GENERATED - DO NOT MODIFY\n"
|
||||
"import lldb\n"
|
||||
"import os\n"
|
||||
"import sys\n"
|
||||
"import shlex\n"
|
||||
"\n"
|
||||
"def connect_command(debugger, command, result, internal_dict):\n"
|
||||
" # These two are passed in by the script which loads us\n"
|
||||
" connect_url = internal_dict['fruitstrap_connect_url']\n"
|
||||
" error = lldb.SBError()\n"
|
||||
"\n"
|
||||
" process = lldb.target.ConnectRemote(lldb.target.GetDebugger().GetListener(), connect_url, None, error)\n"
|
||||
"\n"
|
||||
" # Wait for connection to succeed\n"
|
||||
" listener = lldb.target.GetDebugger().GetListener()\n"
|
||||
" listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged)\n"
|
||||
" events = []\n"
|
||||
" state = (process.GetState() or lldb.eStateInvalid)\n"
|
||||
" while state != lldb.eStateConnected:\n"
|
||||
" event = lldb.SBEvent()\n"
|
||||
" if listener.WaitForEvent(1, event):\n"
|
||||
" state = process.GetStateFromEvent(event)\n"
|
||||
" events.append(event)\n"
|
||||
" else:\n"
|
||||
" state = lldb.eStateInvalid\n"
|
||||
"\n"
|
||||
" # Add events back to queue, otherwise lldb freezes\n"
|
||||
" for event in events:\n"
|
||||
" listener.AddEvent(event)\n"
|
||||
"\n"
|
||||
"def run_command(debugger, command, result, internal_dict):\n"
|
||||
" device_app = internal_dict['fruitstrap_device_app']\n"
|
||||
" args = command.split('--',1)\n"
|
||||
" error = lldb.SBError()\n"
|
||||
" lldb.target.modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))\n"
|
||||
" lldb.target.Launch(lldb.SBLaunchInfo(shlex.split(args[1] and args[1] or '{args}')), error)\n"
|
||||
" lockedstr = ': Locked'\n"
|
||||
" if lockedstr in str(error):\n"
|
||||
" print('\\nDevice Locked\\n')\n"
|
||||
" os._exit(254)\n"
|
||||
" else:\n"
|
||||
" print(str(error))\n"
|
||||
"\n"
|
||||
"def safequit_command(debugger, command, result, internal_dict):\n"
|
||||
" process = lldb.target.process\n"
|
||||
" listener = debugger.GetListener()\n"
|
||||
" listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR)\n"
|
||||
" event = lldb.SBEvent()\n"
|
||||
" while True:\n"
|
||||
" if listener.WaitForEvent(1, event) and lldb.SBProcess.EventIsProcessEvent(event):\n"
|
||||
" state = lldb.SBProcess.GetStateFromEvent(event)\n"
|
||||
" else:\n"
|
||||
" state = process.GetState()\n"
|
||||
"\n"
|
||||
" if state == lldb.eStateRunning:\n"
|
||||
" process.Detach()\n"
|
||||
" os._exit(0)\n"
|
||||
" elif state > lldb.eStateRunning:\n"
|
||||
" os._exit(state)\n"
|
||||
"\n"
|
||||
"def autoexit_command(debugger, command, result, internal_dict):\n"
|
||||
" process = lldb.target.process\n"
|
||||
" listener = debugger.GetListener()\n"
|
||||
" listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR)\n"
|
||||
" event = lldb.SBEvent()\n"
|
||||
" while True:\n"
|
||||
" if listener.WaitForEvent(1, event) and lldb.SBProcess.EventIsProcessEvent(event):\n"
|
||||
" state = lldb.SBProcess.GetStateFromEvent(event)\n"
|
||||
" else:\n"
|
||||
" state = process.GetState()\n"
|
||||
"\n"
|
||||
" if state == lldb.eStateExited:\n"
|
||||
" os._exit(process.GetExitStatus())\n"
|
||||
" elif state == lldb.eStateStopped:\n"
|
||||
" debugger.HandleCommand('bt')\n"
|
||||
" os._exit({exitcode_app_crash})\n"
|
||||
"\n"
|
||||
" stdout = process.GetSTDOUT(1024)\n"
|
||||
" while stdout:\n"
|
||||
" sys.stdout.write(stdout)\n"
|
||||
" stdout = process.GetSTDOUT(1024)\n"
|
||||
"\n"
|
||||
" stderr = process.GetSTDERR(1024)\n"
|
||||
" while stderr:\n"
|
||||
" sys.stdout.write(stderr)\n"
|
||||
" stderr = process.GetSTDERR(1024)\n"
|
@ -1 +1 @@
|
||||
"1.8.4"
|
||||
"1.9.0"
|
@ -36,6 +36,17 @@ xcode_version.on('close', function (code) {
|
||||
if (ver < XCODEBUILD_MIN_VERSION) {
|
||||
console.log(util.format('%s : %s. (you have version %s)', TOOL, XCODEBUILD_NOT_FOUND_MESSAGE, ver));
|
||||
}
|
||||
|
||||
if (os.release() >= '15.0.0') { // print the El Capitan warning
|
||||
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
|
||||
console.log('!!!! WARNING: You are on OS X 10.11 El Capitan, you may need to add the');
|
||||
console.log('!!!! WARNING: `--unsafe-perm=true` flag when running `npm install`');
|
||||
console.log('!!!! WARNING: or else it will fail.');
|
||||
console.log('!!!! WARNING: link:');
|
||||
console.log('!!!! WARNING: https://github.com/phonegap/ios-deploy#os-x-1011-el-capitan');
|
||||
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
|
||||
}
|
||||
|
||||
}
|
||||
process.exit(code);
|
||||
});
|
||||
|
@ -32,7 +32,12 @@ def run_command(debugger, command, result, internal_dict):
|
||||
args = command.split('--',1)
|
||||
error = lldb.SBError()
|
||||
lldb.target.modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))
|
||||
lldb.target.Launch(lldb.SBLaunchInfo(shlex.split(args[1] and args[1] or '{args}')), error)
|
||||
args_arr = []
|
||||
if len(args) > 1:
|
||||
args_arr = shlex.split(args[1])
|
||||
else:
|
||||
args_arr = shlex.split('{args}')
|
||||
lldb.target.Launch(lldb.SBLaunchInfo(args_arr), error)
|
||||
lockedstr = ': Locked'
|
||||
if lockedstr in str(error):
|
||||
print('\\nDevice Locked\\n')
|
||||
@ -42,20 +47,15 @@ def run_command(debugger, command, result, internal_dict):
|
||||
|
||||
def safequit_command(debugger, command, result, internal_dict):
|
||||
process = lldb.target.process
|
||||
listener = debugger.GetListener()
|
||||
listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR)
|
||||
event = lldb.SBEvent()
|
||||
while True:
|
||||
if listener.WaitForEvent(1, event) and lldb.SBProcess.EventIsProcessEvent(event):
|
||||
state = lldb.SBProcess.GetStateFromEvent(event)
|
||||
else:
|
||||
state = process.GetState()
|
||||
|
||||
if state == lldb.eStateRunning:
|
||||
process.Detach()
|
||||
os._exit(0)
|
||||
elif state > lldb.eStateRunning:
|
||||
os._exit(state)
|
||||
else:
|
||||
print('\\nApplication has not been launched\\n')
|
||||
os._exit(1)
|
||||
|
||||
def autoexit_command(debugger, command, result, internal_dict):
|
||||
process = lldb.target.process
|
||||
|
Loading…
Reference in New Issue
Block a user