From bc1bb0d3200d06148cec8914f1522e7fe38c71c8 Mon Sep 17 00:00:00 2001 From: Shazron Abdullah Date: Thu, 16 Jul 2015 17:26:48 -0700 Subject: [PATCH] Fixes #135 - convert Makefile to Xcode project --- Entitlements.plist | 8 - Info.plist | 24 -- ResourceRules.plist | 25 -- demo.c | 9 - ios-deploy-demo/main.m | 17 ++ ios-deploy.xcodeproj/project.pbxproj | 394 +++++++++++++++++++++++++++ MobileDevice.h => src/MobileDevice.h | 0 errors.h => src/errors.h | 0 ios-deploy.c => src/ios-deploy.c | 25 +- 9 files changed, 421 insertions(+), 81 deletions(-) delete mode 100644 Entitlements.plist delete mode 100644 Info.plist delete mode 100644 ResourceRules.plist delete mode 100644 demo.c create mode 100644 ios-deploy-demo/main.m create mode 100644 ios-deploy.xcodeproj/project.pbxproj rename MobileDevice.h => src/MobileDevice.h (100%) rename errors.h => src/errors.h (100%) rename ios-deploy.c => src/ios-deploy.c (99%) diff --git a/Entitlements.plist b/Entitlements.plist deleted file mode 100644 index 929c4e9..0000000 --- a/Entitlements.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - get-task-allow - - - \ No newline at end of file diff --git a/Info.plist b/Info.plist deleted file mode 100644 index c2ade14..0000000 --- a/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleName - demo - CFBundleSupportedPlatforms - - iPhoneOS - - CFBundleExecutable - demo - CFBundleVersion - 1.0 - CFBundleIdentifier - demo - CFBundleResourceSpecification - ResourceRules.plist - LSRequiresIPhoneOS - - CFBundleDisplayName - demo - - \ No newline at end of file diff --git a/ResourceRules.plist b/ResourceRules.plist deleted file mode 100644 index e7ec329..0000000 --- a/ResourceRules.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - rules - - .* - - Info.plist - - omit - - weight - 10 - - ResourceRules.plist - - omit - - weight - 100 - - - - diff --git a/demo.c b/demo.c deleted file mode 100644 index 583f43b..0000000 --- a/demo.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int main(int argc, const char* argv[]) { - int i; - for (i = 0; i < argc; i++) { - printf("argv[%d] = %s\n", i, argv[i]); - } - return 0; -} diff --git a/ios-deploy-demo/main.m b/ios-deploy-demo/main.m new file mode 100644 index 0000000..c64512e --- /dev/null +++ b/ios-deploy-demo/main.m @@ -0,0 +1,17 @@ +// +// main.m +// ios-deploy-demo +// +// Created by shazron on 7/16/15. +// Copyright (c) 2015 PhoneGap. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // insert code here... + NSLog(@"Hello, World!"); + } + return 0; +} diff --git a/ios-deploy.xcodeproj/project.pbxproj b/ios-deploy.xcodeproj/project.pbxproj new file mode 100644 index 0000000..63e2385 --- /dev/null +++ b/ios-deploy.xcodeproj/project.pbxproj @@ -0,0 +1,394 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 7E70899C1B587DE4004D23AA /* ios-deploy.c in Sources */ = {isa = PBXBuildFile; fileRef = 7E7089991B587DE4004D23AA /* ios-deploy.c */; settings = {COMPILER_FLAGS = "-x objective-c -fno-objc-arc"; }; }; + 7E70899E1B587F29004D23AA /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899D1B587F29004D23AA /* CoreFoundation.framework */; }; + 7E7089A01B58801E004D23AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899F1B58801E004D23AA /* Foundation.framework */; }; + 7E7089B31B58826A004D23AA /* demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 7E7089AF1B58826A004D23AA /* demo.c */; }; + 7E7089B41B5882C3004D23AA /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899D1B587F29004D23AA /* CoreFoundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 7E70898C1B587BF3004D23AA /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 7E7089A51B58825B004D23AA /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 7E70898E1B587BF3004D23AA /* ios-deploy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "ios-deploy"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E7089991B587DE4004D23AA /* ios-deploy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ios-deploy.c"; path = "src/ios-deploy.c"; sourceTree = SOURCE_ROOT; }; + 7E70899A1B587DE4004D23AA /* errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = errors.h; path = src/errors.h; sourceTree = SOURCE_ROOT; }; + 7E70899B1B587DE4004D23AA /* MobileDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MobileDevice.h; path = src/MobileDevice.h; sourceTree = SOURCE_ROOT; }; + 7E70899D1B587F29004D23AA /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 7E70899F1B58801E004D23AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 7E7089A71B58825B004D23AA /* ios-deploy-demo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "ios-deploy-demo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E7089A91B58825B004D23AA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 7E7089AF1B58826A004D23AA /* demo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = demo.c; sourceTree = ""; }; + 7E7089B01B58826A004D23AA /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = ""; }; + 7E7089B11B58826A004D23AA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7E7089B21B58826A004D23AA /* ResourceRules.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ResourceRules.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7E70898B1B587BF3004D23AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E7089A01B58801E004D23AA /* Foundation.framework in Frameworks */, + 7E70899E1B587F29004D23AA /* CoreFoundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E7089A41B58825B004D23AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E7089B41B5882C3004D23AA /* CoreFoundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7E7089851B587BF3004D23AA = { + isa = PBXGroup; + children = ( + 7E7089AE1B58826A004D23AA /* demo */, + 7E7089901B587BF3004D23AA /* ios-deploy */, + 7E7089A81B58825B004D23AA /* ios-deploy-demo */, + 7E7089A21B588219004D23AA /* Frameworks */, + 7E70898F1B587BF3004D23AA /* Products */, + ); + sourceTree = ""; + }; + 7E70898F1B587BF3004D23AA /* Products */ = { + isa = PBXGroup; + children = ( + 7E70898E1B587BF3004D23AA /* ios-deploy */, + 7E7089A71B58825B004D23AA /* ios-deploy-demo */, + ); + name = Products; + sourceTree = ""; + }; + 7E7089901B587BF3004D23AA /* ios-deploy */ = { + isa = PBXGroup; + children = ( + 7E7089991B587DE4004D23AA /* ios-deploy.c */, + 7E70899A1B587DE4004D23AA /* errors.h */, + 7E70899B1B587DE4004D23AA /* MobileDevice.h */, + ); + path = "ios-deploy"; + sourceTree = ""; + }; + 7E7089A21B588219004D23AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7E70899F1B58801E004D23AA /* Foundation.framework */, + 7E70899D1B587F29004D23AA /* CoreFoundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 7E7089A81B58825B004D23AA /* ios-deploy-demo */ = { + isa = PBXGroup; + children = ( + 7E7089A91B58825B004D23AA /* main.m */, + ); + path = "ios-deploy-demo"; + sourceTree = ""; + }; + 7E7089AE1B58826A004D23AA /* demo */ = { + isa = PBXGroup; + children = ( + 7E7089AF1B58826A004D23AA /* demo.c */, + 7E7089B01B58826A004D23AA /* Entitlements.plist */, + 7E7089B11B58826A004D23AA /* Info.plist */, + 7E7089B21B58826A004D23AA /* ResourceRules.plist */, + ); + path = demo; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7E70898D1B587BF3004D23AA /* ios-deploy */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E7089951B587BF3004D23AA /* Build configuration list for PBXNativeTarget "ios-deploy" */; + buildPhases = ( + 7E70898A1B587BF3004D23AA /* Sources */, + 7E70898B1B587BF3004D23AA /* Frameworks */, + 7E70898C1B587BF3004D23AA /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ios-deploy"; + productName = "ios-deploy"; + productReference = 7E70898E1B587BF3004D23AA /* ios-deploy */; + productType = "com.apple.product-type.tool"; + }; + 7E7089A61B58825B004D23AA /* ios-deploy-demo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7E7089AB1B58825B004D23AA /* Build configuration list for PBXNativeTarget "ios-deploy-demo" */; + buildPhases = ( + 7E7089A31B58825B004D23AA /* Sources */, + 7E7089A41B58825B004D23AA /* Frameworks */, + 7E7089A51B58825B004D23AA /* CopyFiles */, + 7E7089B51B5882EC004D23AA /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ios-deploy-demo"; + productName = "ios-deploy-demo"; + productReference = 7E7089A71B58825B004D23AA /* ios-deploy-demo */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7E7089861B587BF3004D23AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = PhoneGap; + TargetAttributes = { + 7E70898D1B587BF3004D23AA = { + CreatedOnToolsVersion = 6.4; + }; + 7E7089A61B58825B004D23AA = { + CreatedOnToolsVersion = 6.4; + }; + }; + }; + buildConfigurationList = 7E7089891B587BF3004D23AA /* Build configuration list for PBXProject "ios-deploy" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7E7089851B587BF3004D23AA; + productRefGroup = 7E70898F1B587BF3004D23AA /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 7E70898D1B587BF3004D23AA /* ios-deploy */, + 7E7089A61B58825B004D23AA /* ios-deploy-demo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 7E7089B51B5882EC004D23AA /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "#mkdir -p demo.app\n#cp demo demo.app/\n#cp Info.plist ResourceRules.plist demo.app/\n#codesign -f -s \"iPhone Developer\" --entitlements Entitlements.plist demo.app"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7E70898A1B587BF3004D23AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E70899C1B587DE4004D23AA /* ios-deploy.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7E7089A31B58825B004D23AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E7089B31B58826A004D23AA /* demo.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7E7089931B587BF3004D23AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-framework", + MobileDevice, + "-F/System/Library/PrivateFrameworks", + ); + SDKROOT = macosx; + }; + name = Debug; + }; + 7E7089941B587BF3004D23AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ( + "-framework", + MobileDevice, + "-F/System/Library/PrivateFrameworks", + ); + SDKROOT = macosx; + }; + name = Release; + }; + 7E7089961B587BF3004D23AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 7E7089971B587BF3004D23AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 7E7089AC1B58825B004D23AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 7E7089AD1B58825B004D23AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7E7089891B587BF3004D23AA /* Build configuration list for PBXProject "ios-deploy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E7089931B587BF3004D23AA /* Debug */, + 7E7089941B587BF3004D23AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E7089951B587BF3004D23AA /* Build configuration list for PBXNativeTarget "ios-deploy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E7089961B587BF3004D23AA /* Debug */, + 7E7089971B587BF3004D23AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7E7089AB1B58825B004D23AA /* Build configuration list for PBXNativeTarget "ios-deploy-demo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7E7089AC1B58825B004D23AA /* Debug */, + 7E7089AD1B58825B004D23AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7E7089861B587BF3004D23AA /* Project object */; +} diff --git a/MobileDevice.h b/src/MobileDevice.h similarity index 100% rename from MobileDevice.h rename to src/MobileDevice.h diff --git a/errors.h b/src/errors.h similarity index 100% rename from errors.h rename to src/errors.h diff --git a/ios-deploy.c b/src/ios-deploy.c similarity index 99% rename from ios-deploy.c rename to src/ios-deploy.c index 9966ccd..7a601e1 100644 --- a/ios-deploy.c +++ b/src/ios-deploy.c @@ -169,7 +169,7 @@ char *app_path = NULL; char *device_id = NULL; char *args = NULL; char *list_root = NULL; -int timeout = 0; +int _timeout = 0; int port = 0; // 0 means "dynamically assigned" CFStringRef last_path = NULL; service_conn_t gdbfd; @@ -315,7 +315,7 @@ const char *get_home() { CFStringRef copy_xcode_path_for(CFStringRef subPath, CFStringRef search) { CFStringRef xcodeDevPath = copy_xcode_dev_path(); - CFStringRef path; + CFStringRef path = NULL; bool found = false; const char* home = get_home(); CFRange slashLocation; @@ -846,7 +846,7 @@ int kill_ptree(pid_t root, int signum); void server_callback (CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) { - int res; + ssize_t res; if (CFDataGetLength (data) == 0) { // close the socket on which we've got end-of-file, the server_socket. @@ -956,7 +956,7 @@ int kill_ptree(pid_t root, int signum) { return -1; } - kill_ptree_inner(root, signum, kp, len / sizeof(struct kinfo_proc)); + kill_ptree_inner(root, signum, kp, (int)(len / sizeof(struct kinfo_proc))); free(kp); return 0; @@ -1338,7 +1338,6 @@ void list_bundle_id(AMDeviceRef device) const void *keys[count]; CFDictionaryGetKeysAndValues(result, keys, NULL); for(int i = 0; i < count; ++i) { - CFStringRef test = (CFStringRef)keys[i]; NSLogOut(@"%@", (CFStringRef)keys[i]); } @@ -1485,8 +1484,6 @@ void upload_file(AMDeviceRef device) { void make_directory(AMDeviceRef device) { service_conn_t houseFd = start_house_arrest_service(device); - afc_file_ref file_ref; - afc_connection afc_conn; afc_connection* afc_conn_p = &afc_conn; AFCConnectionOpen(houseFd, 0, &afc_conn_p); @@ -1498,8 +1495,6 @@ void make_directory(AMDeviceRef device) { void remove_path(AMDeviceRef device) { service_conn_t houseFd = start_house_arrest_service(device); - afc_file_ref file_ref; - afc_connection afc_conn; afc_connection* afc_conn_p = &afc_conn; AFCConnectionOpen(houseFd, 0, &afc_conn_p); @@ -1833,7 +1828,7 @@ int main(int argc, char *argv[]) { verbose = 1; break; case 't': - timeout = atoi(optarg); + _timeout = atoi(optarg); break; case 'u': unbuffered = 1; @@ -1922,8 +1917,8 @@ int main(int argc, char *argv[]) { setbuf(stderr, NULL); } - if (detect_only && timeout == 0) { - timeout = 5; + if (detect_only && _timeout == 0) { + _timeout = 5; } if (app_path) { @@ -1933,11 +1928,11 @@ int main(int argc, char *argv[]) { } AMDSetLogLevel(5); // otherwise syslog gets flooded with crap - if (timeout > 0) + if (_timeout > 0) { - CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + timeout, 0, 0, 0, timeout_callback, NULL); + CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + _timeout, 0, 0, 0, timeout_callback, NULL); CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes); - NSLogOut(@"[....] Waiting up to %d seconds for iOS device to be connected", timeout); + NSLogOut(@"[....] Waiting up to %d seconds for iOS device to be connected", _timeout); } else {