Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
88db2f0555 | ||
![]() |
ea8e9dd53b | ||
![]() |
512e741f8b | ||
![]() |
8990de9566 |
13
Makefile
13
Makefile
@@ -1,5 +1,6 @@
|
|||||||
IOS_CC = gcc
|
IOS_CC = gcc
|
||||||
IOS_SDK = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
|
IOS_SDK = $(shell xcode-select --print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
|
||||||
|
DEVICE_SUPPORT = $(shell xcode-select --print-path)/Platforms/iPhoneOS.platform/DeviceSupport
|
||||||
|
|
||||||
all: clean ios-deploy
|
all: clean ios-deploy
|
||||||
|
|
||||||
@@ -12,13 +13,19 @@ demo.app: demo Info.plist
|
|||||||
demo: demo.c
|
demo: demo.c
|
||||||
$(IOS_CC) -arch armv7 -isysroot $(IOS_SDK) -framework CoreFoundation -o demo demo.c
|
$(IOS_CC) -arch armv7 -isysroot $(IOS_SDK) -framework CoreFoundation -o demo demo.c
|
||||||
|
|
||||||
ios-deploy: ios-deploy.c
|
ios-deploy: clean ios-deploy.c
|
||||||
$(IOS_CC) -o ios-deploy -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
|
$(IOS_CC) -o ios-deploy -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
|
||||||
|
|
||||||
install: ios-deploy
|
symlink:
|
||||||
|
cd $(DEVICE_SUPPORT); ln -sfn "`find . -type d -maxdepth 1 -exec basename {} \; | tail -1`" Latest
|
||||||
|
|
||||||
|
install: symlink ios-deploy
|
||||||
mkdir -p $(prefix)/bin
|
mkdir -p $(prefix)/bin
|
||||||
cp ios-deploy $(prefix)/bin
|
cp ios-deploy $(prefix)/bin
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm $(prefix)/bin/ios-deploy
|
||||||
|
|
||||||
debug: all
|
debug: all
|
||||||
./ios-deploy --debug --bundle demo.app
|
./ios-deploy --debug --bundle demo.app
|
||||||
|
|
||||||
|
17
ios-deploy.c
17
ios-deploy.c
@@ -9,10 +9,10 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include "MobileDevice.h"
|
#include "MobileDevice.h"
|
||||||
|
|
||||||
#define APP_VERSION "1.0"
|
#define APP_VERSION "1.0.2"
|
||||||
#define FDVENDOR_PATH "/tmp/ios-deploy-remote-debugserver"
|
#define FDVENDOR_PATH "/tmp/ios-deploy-remote-debugserver"
|
||||||
#define PREP_CMDS_PATH "/tmp/ios-deploy-gdb-prep-cmds"
|
#define PREP_CMDS_PATH "/tmp/ios-deploy-gdb-prep-cmds"
|
||||||
#define GDB_SHELL "/Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin --arch armv7 -q -x " PREP_CMDS_PATH
|
#define GDB_SHELL "`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin --arch armv7 -q -x " PREP_CMDS_PATH
|
||||||
|
|
||||||
// approximation of what Xcode does:
|
// approximation of what Xcode does:
|
||||||
#define GDB_PREP_CMDS CFSTR("set mi-show-protections off\n\
|
#define GDB_PREP_CMDS CFSTR("set mi-show-protections off\n\
|
||||||
@@ -37,7 +37,9 @@
|
|||||||
set inferior-auto-start-cfm off\n\
|
set inferior-auto-start-cfm off\n\
|
||||||
set sharedLibrary load-rules dyld \".*libobjc.*\" all dyld \".*CoreFoundation.*\" all dyld \".*Foundation.*\" all dyld \".*libSystem.*\" all dyld \".*AppKit.*\" all dyld \".*PBGDBIntrospectionSupport.*\" all dyld \".*/usr/lib/dyld.*\" all dyld \".*CarbonDataFormatters.*\" all dyld \".*libauto.*\" all dyld \".*CFDataFormatters.*\" all dyld \"/System/Library/Frameworks\\\\\\\\|/System/Library/PrivateFrameworks\\\\\\\\|/usr/lib\" extern dyld \".*\" all exec \".*\" all\n\
|
set sharedLibrary load-rules dyld \".*libobjc.*\" all dyld \".*CoreFoundation.*\" all dyld \".*Foundation.*\" all dyld \".*libSystem.*\" all dyld \".*AppKit.*\" all dyld \".*PBGDBIntrospectionSupport.*\" all dyld \".*/usr/lib/dyld.*\" all dyld \".*CarbonDataFormatters.*\" all dyld \".*libauto.*\" all dyld \".*CFDataFormatters.*\" all dyld \"/System/Library/Frameworks\\\\\\\\|/System/Library/PrivateFrameworks\\\\\\\\|/usr/lib\" extern dyld \".*\" all exec \".*\" all\n\
|
||||||
sharedlibrary apply-load-rules all\n\
|
sharedlibrary apply-load-rules all\n\
|
||||||
set inferior-auto-start-dyld 1")
|
set inferior-auto-start-dyld 1\n\
|
||||||
|
continue\n\
|
||||||
|
quit\n")
|
||||||
|
|
||||||
typedef struct am_device * AMDeviceRef;
|
typedef struct am_device * AMDeviceRef;
|
||||||
int AMDeviceSecureTransferPath(int zero, AMDeviceRef device, CFURLRef url, CFDictionaryRef options, void *callback, int cbarg);
|
int AMDeviceSecureTransferPath(int zero, AMDeviceRef device, CFURLRef url, CFDictionaryRef options, void *callback, int cbarg);
|
||||||
@@ -95,7 +97,7 @@ CFStringRef copy_device_support_path(AMDeviceRef device) {
|
|||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/%@"), version);
|
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest"));
|
||||||
found = path_exists(path);
|
found = path_exists(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +125,7 @@ CFStringRef copy_developer_disk_image_path(AMDeviceRef device) {
|
|||||||
found = path_exists(path);
|
found = path_exists(path);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Developer/Platforms/iPhoneOS.platform/DeviceSupport/%@ (%@/DeveloperDiskImage.dmg)"), version, build);
|
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Developer/Platforms/iPhoneOS.platform/DeviceSupport/%@ (%@)/DeveloperDiskImage.dmg)"), version, build);
|
||||||
found = path_exists(path);
|
found = path_exists(path);
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
@@ -142,6 +144,11 @@ CFStringRef copy_developer_disk_image_path(AMDeviceRef device) {
|
|||||||
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest/DeveloperDiskImage.dmg"));
|
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest/DeveloperDiskImage.dmg"));
|
||||||
found = path_exists(path);
|
found = path_exists(path);
|
||||||
}
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
path = CFStringCreateWithFormat(NULL, NULL, CFSTR("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/Latest/DeveloperDiskImage.dmg"));
|
||||||
|
found = path_exists(path);
|
||||||
|
}
|
||||||
|
|
||||||
CFRelease(version);
|
CFRelease(version);
|
||||||
CFRelease(build);
|
CFRelease(build);
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ios-deploy",
|
"name": "ios-deploy",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "launch iOS apps iOS devices from the command line (Xcode 4)",
|
"description": "launch iOS apps iOS devices from the command line (Xcode 4)",
|
||||||
"main": "ios-deploy",
|
"main": "ios-deploy",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "make install prefix=/usr/local"
|
"preinstall": "make ios-deploy"
|
||||||
},
|
},
|
||||||
|
"bin" : "./ios-deploy" ,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phonegap/ios-deploy"
|
"url": "https://github.com/phonegap/ios-deploy"
|
||||||
|
Reference in New Issue
Block a user