80 Commits

Author SHA1 Message Date
Shazron Abdullah
2ed9a17914 Updated version to 1.8.7 2016-09-14 02:57:36 -07:00
Shazron Abdullah
feb51d582a Fixes #240 - IndexError: list index out of range
Thanks to https://github.com/gusc (Gusts Kaksis) for the patch.
2016-09-14 02:16:12 -07:00
Shazron Abdullah
d7cccae1ad Increased version to 1.8.6 2016-04-11 14:14:04 -07:00
Alexis Kofman
9871c759e0 Fixes #219 - iOS 9.3 app hangs on splash screen
Fixes cases where process is not yet running.

Signed-off-by: Shazron Abdullah <shazron@apache.org>
2016-04-11 14:11:57 -07:00
Steve Moser
956e925f97 Update for iPhone SE
https://twitter.com/panzer/status/712330579291668480
2016-04-08 18:33:50 -07:00
Alexis Kofman
c769f3cf58 rm autogenerated files from the repo 2016-04-08 18:08:37 -07:00
Alexis Kofman
440454fc5a replace remaining tabs by spaces 2016-04-08 18:08:24 -07:00
Shazron Abdullah
c4cd7b4a55 Increment version to 1.8.5 2016-02-04 09:45:50 -08:00
Shazron Abdullah
d688e29975 Added warning text to the check_reqs.js log when running under OS X 10.11 El Capitan 2016-02-04 09:33:59 -08:00
Steven Kramer
7b07c2e28d Added support for recursive directory uploads 2016-01-19 17:08:05 -08:00
Shazron Abdullah
0159cfc194 Added Testing section in the README 2016-01-12 17:52:11 -08:00
Shazron Abdullah
cbba8a4328 Added npm scripts: test, pycompile 2016-01-12 17:49:32 -08:00
Shazron Abdullah
3a57b33e8f Exported lib-ios-deploy header 2016-01-12 17:42:10 -08:00
Shazron Abdullah
fd12c317b7 Restructured folders into src/ 2016-01-12 17:35:59 -08:00
Shazron Abdullah
ecb228aad4 Added libios-deploy target stub, and XCTests stub. ios-deploy dependent on lib-ios-deploy target 2016-01-12 17:19:51 -08:00
Shazron Abdullah
3555b1222c Typo in Run Script that resulted in appending contents to lldb.py.h 2016-01-05 17:42:36 -08:00
Shazron Abdullah
3fef0a5600 Externalized LLDB_FRUITSTRAP_MODULE python commands into external file (source in src/scripts/lldb.py) 2016-01-05 17:33:53 -08:00
Shazron Abdullah
ca29173c80 Externalize version string into a header file (version must be in double quotes) 2016-01-05 16:21:19 -08:00
Shazron Abdullah
e57a4da108 Fixes #194 - Segmentation fault: 11 (related) 2016-01-05 16:04:22 -08:00
Shazron Abdullah
a9e96416a8 Fixes #194 - Segmentation fault: 11 2016-01-05 16:00:12 -08:00
Shazron Abdullah
922f8483a7 Updated version to 1.8.4 2016-01-05 13:19:20 -08:00
Shazron Abdullah
f0ae11a93f Add a note in CONTRIBUTING.md to check out the El Capitan section of the README. Closes #201 2016-01-05 10:52:36 -08:00
Shazron Abdullah
c0988f07e5 Fix README - El Capitan section. Closes #200 2016-01-05 10:50:53 -08:00
Shazron Abdullah
a36b169782 Added --allow-root to El-Capitan notes, and =true to --unsafe-perm 2016-01-04 17:40:06 -08:00
Shazron Abdullah
551cdc5804 Added docs for --no-wifi option 2015-11-23 17:27:52 -08:00
Shazron Abdullah
94d56d74c4 Updated demo Makefile for Xcode 7.1 (iOS 9.1) 2015-11-23 17:27:39 -08:00
Shazron Abdullah
f17fd4c73a Updated version to 1.8.3 2015-11-23 17:22:07 -08:00
Shazron Abdullah
28ceb4733f Merge pull request #192 from jcworsley/master
Added no-wifi option to explicitly skip wifi connectivity.
2015-11-23 17:12:18 -08:00
John C. Worsley
6a8ad1e899 Added no-wifi option to explicitly skip wifi connectivity. 2015-11-09 16:26:19 -08:00
Shazron Abdullah
3ee31bc677 Typo: had two "scripts" sections in package.son 2015-10-12 17:02:05 -07:00
Shazron Abdullah
fccfde865a Increment version to 1.8.2 2015-10-12 16:56:13 -07:00
Shazron Abdullah
f6b4c3f951 Ignore node_modules 2015-10-12 16:55:59 -07:00
Shazron Abdullah
b1c717ebd8 Removed check_reqs.js 2015-10-12 16:55:43 -07:00
Shazron Abdullah
1220cac6e4 Moved check_reqs.js to src, added jshint to npm test 2015-10-12 16:55:08 -07:00
Shazron Abdullah
6f65bb687e Fixes #183 - 'tool' undefined in check_reqs.js 2015-10-12 16:49:04 -07:00
Shazron Abdullah
7af1a9d79b Fixes #184 - Change min xcode version for Travis CI 2015-10-12 16:48:41 -07:00
Shazron Abdullah
23ea3b7097 Updated package.json ver to 1.8.1 2015-10-08 16:07:12 -07:00
Shazron Abdullah
9909fb854c Updated version to 1.8.1 2015-10-08 16:06:15 -07:00
Shazron Abdullah
0320381c67 Fixes #182 - ios-deploy terminates with code 11 in difficult to pinpoint circumstances 2015-10-08 16:06:01 -07:00
Shazron Abdullah
612c3561fd Added verbose logging for #170 2015-10-08 16:05:03 -07:00
Shazron Abdullah
59904aa4c1 Updated README for new build from source instruction 2015-10-06 23:40:42 -07:00
Shazron Abdullah
9f6b41519b Merge branch '135-xcode-project' 2015-10-06 23:10:10 -07:00
Shazron Abdullah
5d2166fcef Fixes #135 - Convert Makefile to xcodeproject. Demo in its own folder now with its own Makefile. 2015-10-06 23:06:45 -07:00
Shazron Abdullah
6ce22c2adc Fixes #176 - Add documentation issue for node preinstall script (workaround) 2015-10-06 22:48:33 -07:00
Shazron Abdullah
ede5d2542d Fixes #156 - --list command add trailing slash for directories 2015-10-06 22:48:33 -07:00
Shazron Abdullah
6b7b31d54a check_reqs - removed shelljs dependency 2015-10-06 22:48:33 -07:00
Shazron Abdullah
8d60757e77 Fixes #167 - On El Cap, detect Xcode 7 properly installed 2015-10-06 22:48:33 -07:00
Shazron Abdullah
2f9fb4304a Incremented version to 1.8.0 2015-10-06 22:48:33 -07:00
Shazron Abdullah
a6e94923cf Fixes #170 - ios-deploy installing over both USB and WiFi 2015-10-06 22:48:32 -07:00
Shazron Abdullah
342965c16a Added iPhone 6s and 6s Plus models. 2015-10-06 22:48:32 -07:00
Shazron Abdullah
4ce3554561 Fixes #164 - Error when launch application in multi-user context 2015-10-06 22:48:32 -07:00
Shazron Abdullah
ab39342b0f Fixes #166 - Segfault when passed a non-existent bundle #166 2015-10-06 22:48:32 -07:00
Shazron Abdullah
2a1844500b Fixes #168 - Segmentation Fault 11 (when deploying an .ipa file) 2015-10-06 22:48:32 -07:00
Shazron Abdullah
5e7420502b Fixes #56 - Assertion failed AMDeviceSecureTransferPath (app name has non-ASCII characters) 2015-10-06 22:48:31 -07:00
Shazron Abdullah
545521954b Fixed typo in README example. 2015-10-06 22:48:31 -07:00
Shazron Abdullah
d6216760e4 Fixes #153 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString' #153 2015-10-06 22:48:31 -07:00
Julius Trinkunas
0390522194 Add text for errors 0xe8008016 and 0xe8008017. 2015-10-06 22:48:31 -07:00
Julius Trinkunas
ca2e7a3c75 Add attribution for error code reverse engineering. Second try. 2015-10-06 22:48:31 -07:00
Julius Trinkunas
ed7c70aa59 Add attribution for error code reverse engineering. 2015-10-06 22:48:31 -07:00
Julius Trinkunas
093b4b3c9a Add text for error 0xe8008018. 2015-10-06 22:48:30 -07:00
Julius Trinkunas
4d58838ef1 Add text for 0xe800801c error. 2015-10-06 22:48:30 -07:00
Julius Trinkunas
d10562c501 Add text for 0xe8008019 error. 2015-10-06 22:48:30 -07:00
Julius Trinkunas
99dba4e58c Fixes #157 - Bad error formatting string in check_error() 2015-10-06 22:48:30 -07:00
Shazron Abdullah
bf58b61561 Fixes #176 - Add documentation issue for node preinstall script (workaround) 2015-10-06 22:13:04 -07:00
Shazron Abdullah
d2aee71a92 Fixes #156 - --list command add trailing slash for directories 2015-10-06 22:06:28 -07:00
Shazron Abdullah
92f6238bba check_reqs - removed shelljs dependency 2015-10-06 22:01:36 -07:00
Shazron Abdullah
6aa7b57014 Fixes #167 - On El Cap, detect Xcode 7 properly installed 2015-10-06 17:46:50 -07:00
Shazron Abdullah
55d076b805 Incremented version to 1.8.0 2015-10-06 17:11:14 -07:00
Shazron Abdullah
3756385651 Fixes #170 - ios-deploy installing over both USB and WiFi 2015-10-06 16:51:27 -07:00
Shazron Abdullah
adc8a5b9c2 Added iPhone 6s and 6s Plus models. 2015-10-06 15:47:59 -07:00
Shazron Abdullah
bb25caf586 Fixes #164 - Error when launch application in multi-user context 2015-10-06 15:39:57 -07:00
Shazron Abdullah
75820a0979 Fixes #166 - Segfault when passed a non-existent bundle #166 2015-10-06 14:00:42 -07:00
Shazron Abdullah
16f52589db Fixes #168 - Segmentation Fault 11 (when deploying an .ipa file) 2015-10-06 13:43:28 -07:00
Shazron Abdullah
21c8dc9cf5 Fixes #56 - Assertion failed AMDeviceSecureTransferPath (app name has non-ASCII characters) 2015-10-06 13:33:51 -07:00
Shazron Abdullah
34540ce545 Fixed typo in README example. 2015-10-06 13:18:50 -07:00
Shazron Abdullah
7b834b0e31 Fixes #153 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString' #153 2015-10-06 13:14:21 -07:00
Shazron Abdullah
7ac9cdb107 Merge pull request #172 from Unity-Technologies/error-messages
Add text for errors 0xe8008016 and 0xe8008017.
2015-09-15 10:07:24 -07:00
Julius Trinkunas
cf9d024a2b Add text for errors 0xe8008016 and 0xe8008017. 2015-09-15 18:14:37 +03:00
Shazron Abdullah
bc1bb0d320 Fixes #135 - convert Makefile to Xcode project 2015-07-16 17:26:48 -07:00
Shazron Abdullah
7d997b89c7 Removed buildbox shell script 2015-07-16 16:57:24 -07:00
24 changed files with 1166 additions and 341 deletions

8
.gitignore vendored
View File

@@ -1,6 +1,6 @@
demo
demo.app
ios-deploy
ios-deploy.dSYM
build/*
node_modules/*
/.DS_Store
*~
src/scripts/lldb.pyc
src/ios-deploy/lldb.py.h

View File

@@ -23,6 +23,8 @@ Please run the commands below in your Terminal.app and include it in the issue:
```
Also include **command line arguments** you used for ios-deploy.
Don't forget to check out the [El Capitan](https://github.com/phonegap/ios-deploy/blob/master/README.md#os-x-1011-el-capitan) section of the [README](https://github.com/phonegap/ios-deploy/blob/master/README.md) before filing that issue!
## Sending a Pull Request

View File

@@ -1,35 +0,0 @@
IOS_SDK_VERSION = 8.3
IOS_CC = gcc -ObjC
DEVICE_SUPPORT = $(shell xcode-select --print-path)/Platforms/iPhoneOS.platform/DeviceSupport
IOS_SDK = $(shell xcode-select --print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk
all: clean ios-deploy demo.app
demo.app: demo Info.plist
mkdir -p demo.app
cp demo demo.app/
cp Info.plist ResourceRules.plist demo.app/
codesign -f -s "iPhone Developer" --entitlements Entitlements.plist demo.app
demo: demo.c
$(IOS_CC) -g -arch armv7 -isysroot $(IOS_SDK) -framework CoreFoundation -o demo demo.c
ios-deploy: clean ios-deploy.c
$(IOS_CC) -g -o ios-deploy -framework Foundation -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
symlink:
cd $(DEVICE_SUPPORT); ln -sfn "`find . -type d -maxdepth 1 -exec basename {} \; | tail -1`" Latest
install: symlink ios-deploy
mkdir -p $(prefix)/bin
cp ios-deploy $(prefix)/bin
uninstall:
rm $(prefix)/bin/ios-deploy
debug: all
./ios-deploy --debug --bundle demo.app
clean:
@rm -rf *.app demo ios-deploy

View File

@@ -4,9 +4,9 @@ Install and debug iOS apps without using Xcode. Designed to work on un-jailbroke
## Requirements
* Mac OS X. Tested on 10.10 Yosemite and iOS 8.3
* Mac OS X. Tested on 10.11 El Capitan and iOS 9.0
* You need to have a valid iOS Development certificate installed.
* Xcode 6 or greater should be installed
* Xcode 6.4 or greater should be installed
## Roadmap
@@ -32,42 +32,59 @@ Now install ios-deploy with the [node.js](https://nodejs.org) package manager:
npm install -g ios-deploy
```
To install from source:
To build from source:
```
make install prefix=/usr/local
xcodebuild
```
This will install ios-deploy in the `bin` folder of `/usr/local`, i.e. `/usr/local/bin`
This will build `ios-deploy` into the `build/Release` folder.
## Testing
Run:
```
npm install && npm test
```
### OS X 10.11 El Capitan
If you are *not* using a node version manager like [nvm](https://github.com/creationix/nvm) or [n](https://github.com/tj/n), you may have to do either of these three things below when under El Capitan:
1. Add the `--unsafe-perm=true` flag when installing ios-deploy
2. Add the `--allow-root` flag when installing ios-deploy
3. Ensure the `nobody` user has write access to `/usr/local/lib/node_modules/ios-deploy/ios-deploy`
## Usage
Usage: ios-deploy [OPTION]...
-d, --debug launch the app in GDB after installation
-i, --id <device_id> the id of the device to connect to
-c, --detect only detect if the device is connected
-b, --bundle <bundle.app> the path to the app bundle to be installed
-a, --args <args> command line arguments to pass to the app when launching it
-t, --timeout <timeout> number of seconds to wait for a device to be connected
-u, --unbuffered don't buffer stdout
-n, --nostart do not start the app when debugging
-I, --noninteractive start in non interactive mode (quit when app crashes or exits)
-L, --justlaunch just launch the app and exit lldb
-v, --verbose enable verbose output
-m, --noinstall directly start debugging without app install (-d not required)
-p, --port <number> port used for device, default: 12345
-r, --uninstall uninstall the app before install (do not use with -m; app cache and data are cleared)
-9, --uninstall_only uninstall the app ONLY. Use only with -1 <bundle_id>
-1, --bundle_id <bundle id> specify bundle id for list, upload, and uninstall_only
-l, --list list files
-o, --upload <file> upload file
-w, --download download app tree
-2, --to <target pathname> use together with up/download file/tree. specify target
-D, --mkdir <dir> make directory on device
-R, --rm <path> remove file or directory on device (directories must be empty)
-V, --version print the executable version
-e, --exists check if the app with given bundle_id is installed or not
-B, --list_bundle_id list bundle_id
-d, --debug launch the app in lldb after installation
-i, --id <device_id> the id of the device to connect to
-c, --detect only detect if the device is connected
-b, --bundle <bundle.app> the path to the app bundle to be installed
-a, --args <args> command line arguments to pass to the app when launching it
-t, --timeout <timeout> number of seconds to wait for a device to be connected
-u, --unbuffered don't buffer stdout
-n, --nostart do not start the app when debugging
-I, --noninteractive start in non interactive mode (quit when app crashes or exits)
-L, --justlaunch just launch the app and exit lldb
-v, --verbose enable verbose output
-m, --noinstall directly start debugging without app install (-d not required)
-p, --port <number> port used for device, default: dynamic
-r, --uninstall uninstall the app before install (do not use with -m; app cache and data are cleared)
-9, --uninstall_only uninstall the app ONLY. Use only with -1 <bundle_id>
-1, --bundle_id <bundle id> specify bundle id for list and upload
-l, --list list files
-o, --upload <file> upload file
-w, --download download app tree
-2, --to <target pathname> use together with up/download file/tree. specify target
-D, --mkdir <dir> make directory on device
-R, --rm <path> remove file or directory on device (directories must be empty)
-V, --version print the executable version
-e, --exists check if the app with given bundle_id is installed or not
-B, --list_bundle_id list bundle_id
-W, --no-wifi ignore wifi devices
## Examples
@@ -76,6 +93,9 @@ The commands below assume that you have an app called `my.app` with bundle id `b
// deploy and debug your app to a connected device
ios-deploy --debug --bundle my.app
// deploy and debug your app to a connected device, skipping any wi-fi connection (use USB)
ios-deploy --debug --bundle my.app --no-wifi
// deploy and launch your app to a connected device, but quit the debugger after
ios-deploy --justlaunch --debug --bundle my.app
@@ -98,7 +118,7 @@ The commands below assume that you have an app called `my.app` with bundle id `b
ios-deploy --exists --bundle_id com.apple.mobilemail
// Download the Documents directory of the app *only*
ios-deploy --download=/Documents -bundle_id my.app.id --to ./my_download_location
ios-deploy --download=/Documents --bundle_id my.app.id --to ./my_download_location
// List ids and names of connected devices
ios-deploy -c
@@ -113,7 +133,7 @@ The commands below assume that you have an app called `my.app` with bundle id `b
The included demo.app represents the minimum required to get code running on iOS.
* `make demo.app` will generate the demo.app executable. If it doesn't compile, modify IOS_SDK_VERSION in the Makefile.
* `make demo.app` will generate the demo.app executable. If it doesn't compile, modify `IOS_SDK_VERSION` in the Makefile.
* `make debug` will install demo.app and launch a LLDB session.
## Notes

5
demo/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
demo
demo.app
demo.dSYM
/.DS_Store
*~

24
demo/Makefile Normal file
View File

@@ -0,0 +1,24 @@
IOS_SDK_VERSION = 9.1
IOS_CC = gcc -ObjC
IOS_SDK = $(shell xcode-select --print-path)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk
all: clean demo.app
demo.app: demo Info.plist
mkdir -p demo.app
cp demo demo.app/
cp Info.plist ResourceRules.plist demo.app/
codesign -f -s "iPhone Developer" --entitlements Entitlements.plist demo.app
demo: demo.c
$(IOS_CC) -g -arch armv7 -isysroot $(IOS_SDK) -framework CoreFoundation -o demo demo.c
debug: all ios-deploy
@../build/Release/ios-deploy --debug --bundle demo.app
clean:
@rm -rf *.app demo demo.dSYM
ios-deploy:
@xcodebuild -project ../ios-deploy.xcodeproj

View File

@@ -6,4 +6,4 @@ int main(int argc, const char* argv[]) {
printf("argv[%d] = %s\n", i, argv[i]);
}
return 0;
}
}

View File

@@ -0,0 +1,537 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
7E70899E1B587F29004D23AA /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899D1B587F29004D23AA /* CoreFoundation.framework */; };
7E7089A01B58801E004D23AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899F1B58801E004D23AA /* Foundation.framework */; };
7E8E3A861C45D4CE0017F6C1 /* ios_deploy_tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E8E3A851C45D4CE0017F6C1 /* ios_deploy_tests.m */; };
7E8E3A921C45D5380017F6C1 /* libios_deploy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E8E3A911C45D5380017F6C1 /* libios_deploy.h */; settings = {ATTRIBUTES = (Public, ); }; };
7E8E3A941C45D5380017F6C1 /* libios_deploy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E8E3A931C45D5380017F6C1 /* libios_deploy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
7E8E3A9B1C45D5970017F6C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899F1B58801E004D23AA /* Foundation.framework */; };
7E8E3A9D1C45D6290017F6C1 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E70899D1B587F29004D23AA /* CoreFoundation.framework */; };
7EDCC3CD1C45DC94002F9851 /* ios-deploy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E7089991B587DE4004D23AA /* ios-deploy.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
7E8E3A991C45D5850017F6C1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E7089861B587BF3004D23AA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7E8E3A8E1C45D5380017F6C1;
remoteInfo = "ios-deploy-lib";
};
7EDCC3CA1C45D933002F9851 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E7089861B587BF3004D23AA /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7E8E3A8E1C45D5380017F6C1;
remoteInfo = "ios-deploy-lib";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
7E1C00CC1C3C93AF00D686B5 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
7E1C00CF1C3C9ABB00D686B5 /* lldb.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = lldb.py; path = src/scripts/lldb.py; sourceTree = SOURCE_ROOT; };
7E1C00D11C3C9CB000D686B5 /* lldb.py.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lldb.py.h; sourceTree = "<group>"; };
7E70898E1B587BF3004D23AA /* ios-deploy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "ios-deploy"; sourceTree = BUILT_PRODUCTS_DIR; };
7E7089991B587DE4004D23AA /* ios-deploy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ios-deploy.m"; sourceTree = "<group>"; };
7E70899A1B587DE4004D23AA /* errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errors.h; sourceTree = "<group>"; };
7E70899B1B587DE4004D23AA /* MobileDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileDevice.h; sourceTree = "<group>"; };
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; };
7E8E3A831C45D4CE0017F6C1 /* ios-deploy-tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ios-deploy-tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
7E8E3A851C45D4CE0017F6C1 /* ios_deploy_tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ios_deploy_tests.m; sourceTree = "<group>"; };
7E8E3A871C45D4CE0017F6C1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7E8E3A8F1C45D5380017F6C1 /* libios-deploy.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libios-deploy.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7E8E3A911C45D5380017F6C1 /* libios_deploy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libios_deploy.h; sourceTree = "<group>"; };
7E8E3A931C45D5380017F6C1 /* libios_deploy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libios_deploy.m; sourceTree = "<group>"; };
7EDCC3CE1C45DFF0002F9851 /* check_reqs.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = check_reqs.js; sourceTree = "<group>"; };
/* 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;
};
7E8E3A801C45D4CE0017F6C1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
7E8E3A8C1C45D5380017F6C1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7E8E3A9D1C45D6290017F6C1 /* CoreFoundation.framework in Frameworks */,
7E8E3A9B1C45D5970017F6C1 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7E1C00CE1C3C9A7700D686B5 /* scripts */ = {
isa = PBXGroup;
children = (
7EDCC3CE1C45DFF0002F9851 /* check_reqs.js */,
7E1C00CF1C3C9ABB00D686B5 /* lldb.py */,
);
name = scripts;
path = src/scripts;
sourceTree = "<group>";
};
7E7089851B587BF3004D23AA = {
isa = PBXGroup;
children = (
7E1C00CE1C3C9A7700D686B5 /* scripts */,
7E7089901B587BF3004D23AA /* ios-deploy */,
7E8E3A841C45D4CE0017F6C1 /* ios-deploy-tests */,
7E8E3A901C45D5380017F6C1 /* ios-deploy-lib */,
7E7089A21B588219004D23AA /* Frameworks */,
7E70898F1B587BF3004D23AA /* Products */,
);
sourceTree = "<group>";
};
7E70898F1B587BF3004D23AA /* Products */ = {
isa = PBXGroup;
children = (
7E70898E1B587BF3004D23AA /* ios-deploy */,
7E8E3A831C45D4CE0017F6C1 /* ios-deploy-tests.xctest */,
7E8E3A8F1C45D5380017F6C1 /* libios-deploy.a */,
);
name = Products;
sourceTree = "<group>";
};
7E7089901B587BF3004D23AA /* ios-deploy */ = {
isa = PBXGroup;
children = (
7E1C00D11C3C9CB000D686B5 /* lldb.py.h */,
7E1C00CC1C3C93AF00D686B5 /* version.h */,
7E7089991B587DE4004D23AA /* ios-deploy.m */,
7E70899A1B587DE4004D23AA /* errors.h */,
7E70899B1B587DE4004D23AA /* MobileDevice.h */,
);
name = "ios-deploy";
path = "src/ios-deploy";
sourceTree = "<group>";
};
7E7089A21B588219004D23AA /* Frameworks */ = {
isa = PBXGroup;
children = (
7E70899F1B58801E004D23AA /* Foundation.framework */,
7E70899D1B587F29004D23AA /* CoreFoundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
7E8E3A841C45D4CE0017F6C1 /* ios-deploy-tests */ = {
isa = PBXGroup;
children = (
7E8E3A851C45D4CE0017F6C1 /* ios_deploy_tests.m */,
7E8E3A871C45D4CE0017F6C1 /* Info.plist */,
);
name = "ios-deploy-tests";
path = "src/ios-deploy-tests";
sourceTree = "<group>";
};
7E8E3A901C45D5380017F6C1 /* ios-deploy-lib */ = {
isa = PBXGroup;
children = (
7E8E3A911C45D5380017F6C1 /* libios_deploy.h */,
7E8E3A931C45D5380017F6C1 /* libios_deploy.m */,
);
name = "ios-deploy-lib";
path = "src/ios-deploy-lib";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
7E8E3A8D1C45D5380017F6C1 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
7E8E3A921C45D5380017F6C1 /* libios_deploy.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
7E70898D1B587BF3004D23AA /* ios-deploy */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E7089951B587BF3004D23AA /* Build configuration list for PBXNativeTarget "ios-deploy" */;
buildPhases = (
7EDCC3CF1C45E03B002F9851 /* ShellScript */,
7E70898B1B587BF3004D23AA /* Frameworks */,
7EDCC3CC1C45DC89002F9851 /* Sources */,
);
buildRules = (
);
dependencies = (
7E8E3A9A1C45D5850017F6C1 /* PBXTargetDependency */,
);
name = "ios-deploy";
productName = "ios-deploy";
productReference = 7E70898E1B587BF3004D23AA /* ios-deploy */;
productType = "com.apple.product-type.tool";
};
7E8E3A821C45D4CE0017F6C1 /* ios-deploy-tests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E8E3A8A1C45D4CE0017F6C1 /* Build configuration list for PBXNativeTarget "ios-deploy-tests" */;
buildPhases = (
7E8E3A7F1C45D4CE0017F6C1 /* Sources */,
7E8E3A801C45D4CE0017F6C1 /* Frameworks */,
7E8E3A811C45D4CE0017F6C1 /* Resources */,
);
buildRules = (
);
dependencies = (
7EDCC3CB1C45D933002F9851 /* PBXTargetDependency */,
);
name = "ios-deploy-tests";
productName = "ios-deploy-tests";
productReference = 7E8E3A831C45D4CE0017F6C1 /* ios-deploy-tests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
7E8E3A8E1C45D5380017F6C1 /* ios-deploy-lib */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E8E3A951C45D5380017F6C1 /* Build configuration list for PBXNativeTarget "ios-deploy-lib" */;
buildPhases = (
7E8E3A8B1C45D5380017F6C1 /* Sources */,
7E8E3A8C1C45D5380017F6C1 /* Frameworks */,
7E8E3A8D1C45D5380017F6C1 /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = "ios-deploy-lib";
productName = "ios-deploy-lib";
productReference = 7E8E3A8F1C45D5380017F6C1 /* libios-deploy.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7E7089861B587BF3004D23AA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = PhoneGap;
TargetAttributes = {
7E70898D1B587BF3004D23AA = {
CreatedOnToolsVersion = 6.4;
};
7E8E3A821C45D4CE0017F6C1 = {
CreatedOnToolsVersion = 7.2;
};
7E8E3A8E1C45D5380017F6C1 = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = 7E7089891B587BF3004D23AA /* Build configuration list for PBXProject "ios-deploy" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 7E7089851B587BF3004D23AA;
productRefGroup = 7E70898F1B587BF3004D23AA /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7E70898D1B587BF3004D23AA /* ios-deploy */,
7E8E3A821C45D4CE0017F6C1 /* ios-deploy-tests */,
7E8E3A8E1C45D5380017F6C1 /* ios-deploy-lib */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7E8E3A811C45D4CE0017F6C1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
7EDCC3CF1C45E03B002F9851 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "echo \"\\\"# AUTO-GENERATED - DO NOT MODIFY\\n\\\"\" > src/ios-deploy/lldb.py.h\nawk '{ print \"\\\"\"$0\"\\\\n\\\"\"}' src/scripts/lldb.py >> src/ios-deploy/lldb.py.h";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7E8E3A7F1C45D4CE0017F6C1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E8E3A861C45D4CE0017F6C1 /* ios_deploy_tests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7E8E3A8B1C45D5380017F6C1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E8E3A941C45D5380017F6C1 /* libios_deploy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7EDCC3CC1C45DC89002F9851 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7EDCC3CD1C45DC94002F9851 /* ios-deploy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
7E8E3A9A1C45D5850017F6C1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7E8E3A8E1C45D5380017F6C1 /* ios-deploy-lib */;
targetProxy = 7E8E3A991C45D5850017F6C1 /* PBXContainerItemProxy */;
};
7EDCC3CB1C45D933002F9851 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7E8E3A8E1C45D5380017F6C1 /* ios-deploy-lib */;
targetProxy = 7EDCC3CA1C45D933002F9851 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency 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;
ENABLE_TESTABILITY = 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;
};
7E8E3A881C45D4CE0017F6C1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "src/ios-deploy-tests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.phonegap.ios-deploy-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
7E8E3A891C45D4CE0017F6C1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "src/ios-deploy-tests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.phonegap.ios-deploy-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
7E8E3A961C45D5380017F6C1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
EXECUTABLE_PREFIX = lib;
INSTALL_PATH = "";
MACOSX_DEPLOYMENT_TARGET = 10.11;
OTHER_LDFLAGS = (
"-framework",
MobileDevice,
"-F/System/Library/PrivateFrameworks",
);
PRODUCT_NAME = "ios-deploy";
PUBLIC_HEADERS_FOLDER_PATH = "";
};
name = Debug;
};
7E8E3A971C45D5380017F6C1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
EXECUTABLE_PREFIX = lib;
INSTALL_PATH = "";
MACOSX_DEPLOYMENT_TARGET = 10.11;
OTHER_LDFLAGS = (
"-framework",
MobileDevice,
"-F/System/Library/PrivateFrameworks",
);
PRODUCT_NAME = "ios-deploy";
PUBLIC_HEADERS_FOLDER_PATH = "";
};
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;
};
7E8E3A8A1C45D4CE0017F6C1 /* Build configuration list for PBXNativeTarget "ios-deploy-tests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E8E3A881C45D4CE0017F6C1 /* Debug */,
7E8E3A891C45D4CE0017F6C1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E8E3A951C45D5380017F6C1 /* Build configuration list for PBXNativeTarget "ios-deploy-lib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E8E3A961C45D5380017F6C1 /* Debug */,
7E8E3A971C45D5380017F6C1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 7E7089861B587BF3004D23AA /* Project object */;
}

View File

@@ -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>

View File

@@ -1,21 +1,34 @@
{
"name": "ios-deploy",
"version": "1.7.0",
"os" : [ "darwin" ],
"description": "launch iOS apps iOS devices from the command line (Xcode 6)",
"version": "1.8.7",
"os": [
"darwin"
],
"description": "launch iOS apps iOS devices from the command line (Xcode 7)",
"main": "ios-deploy",
"scripts": {
"preinstall": "make ios-deploy"
},
"bin" : "./ios-deploy" ,
"bin": "./build/Release/ios-deploy",
"repository": {
"type": "git",
"url": "https://github.com/phonegap/ios-deploy"
},
"devDependencies": {
"jshint": "2.5.8"
},
"scripts": {
"preinstall": "./src/scripts/check_reqs.js && xcodebuild",
"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"
},
"keywords": [
"ios-deploy",
"deploy to iOS device"
],
"bugs": {
"url": "https://github.com/phonegap/ios-deploy/issues"
},
"author": "Greg Hughes",
"license": "GPLv3"
}

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
echo "$ make"
make

View File

@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface ios_deploy_lib : NSObject
@end

View File

@@ -0,0 +1,5 @@
#import "libios_deploy.h"
@implementation ios_deploy_lib
@end

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -0,0 +1,31 @@
#import <XCTest/XCTest.h>
@interface ios_deploy_tests : XCTestCase
@end
@implementation ios_deploy_tests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end

View File

@@ -195,6 +195,7 @@ mach_error_t AMDeviceNotificationSubscribe(am_device_notification_callback
callback, unsigned int unused0, unsigned int unused1, void* //unsigned int
dn_unknown3, struct am_device_notification **notification);
/* Connects to the iPhone. Pass in the am_device structure that the
* notification callback will give to you.
*

View File

@@ -192,6 +192,8 @@ static errorcode_to_id_t errorcode_to_id[] = {
// Errors without id->string mapping.
{ 0xe8008015, "A valid provisioning profile for this executable was not found." },
{ 0xe8008016, "The entitlements specified in your applications Code Signing Entitlements file do not match those specified in your provisioning profile." },
{ 0xe8008017, "A signed resource has been added, modified, or deleted." },
{ 0xe8008018, "The identity used to sign the executable is no longer valid. Please verify that your devices clock is properly set, and that your signing certificate is not expired." },
{ 0xe8008019, "The application does not have a valid signature." },
{ 0xe800801c, "No code signature found." },

View File

@@ -18,9 +18,8 @@
#include "MobileDevice.h"
#include "errors.h"
#define APP_VERSION @"1.7.0"
#define PREP_CMDS_PATH "/tmp/fruitstrap-lldb-prep-cmds-"
#define LLDB_SHELL "lldb -s " PREP_CMDS_PATH
#define PREP_CMDS_PATH @"/tmp/%@/fruitstrap-lldb-prep-cmds-"
#define LLDB_SHELL @"lldb -s %@"
/*
* Startup script passed to lldb.
* To see how xcode interacts with lldb, put this into .lldbinit:
@@ -61,93 +60,10 @@ const char* lldb_prep_noninteractive_cmds = "\
* through the python interface. Also, Launch () doesn't seem to work when ran from init_module (), so we add
* a command which can be used by the user to run it.
*/
#define LLDB_FRUITSTRAP_MODULE CFSTR("\
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\
")
NSString* LLDB_FRUITSTRAP_MODULE = @
#include "lldb.py.h"
;
typedef struct am_device * AMDeviceRef;
mach_error_t AMDeviceSecureStartService(struct am_device *device, CFStringRef service_name, unsigned int *unknown, service_conn_t *handle);
@@ -157,11 +73,11 @@ int AMDeviceMountImage(AMDeviceRef device, CFStringRef image, CFDictionaryRef op
mach_error_t AMDeviceLookupApplications(AMDeviceRef device, CFDictionaryRef options, CFDictionaryRef *result);
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;
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;
@@ -169,8 +85,8 @@ char *app_path = NULL;
char *device_id = NULL;
char *args = NULL;
char *list_root = NULL;
int timeout = 0;
int port = 0; // 0 means "dynamically assigned"
int _timeout = 0;
int port = 0; // 0 means "dynamically assigned"
CFStringRef last_path = NULL;
service_conn_t gdbfd;
pid_t parent = 0;
@@ -179,6 +95,8 @@ pid_t child = 0;
// Signal sent from child to parent process when LLDB finishes.
const int SIGLLDB = SIGUSR1;
AMDeviceRef best_device_match = NULL;
NSString* tmpUUID;
struct am_device_notification *notify;
// Error codes we report on different failures, so scripts can distinguish between user app exit
// codes and our exit codes. For non app errors we use codes in reserved 128-255 range.
@@ -204,8 +122,8 @@ void on_error(NSString* format, ...)
NSString* str = [[[NSString alloc] initWithFormat:format arguments:valist] autorelease];
va_end(valist);
NSLog(@"[ !! ] %@", str);
NSLog(@"[ !! ] %@", str);
exit(exitcode_error);
}
@@ -217,17 +135,39 @@ void on_sys_error(NSString* format, ...) {
va_start(valist, format);
NSString* str = [[[NSString alloc] initWithFormat:format arguments:valist] autorelease];
va_end(valist);
on_error(@"%@ : %@", str, errstr);
on_error(@"%@ : %@", str, [NSString stringWithUTF8String:errstr]);
}
void __NSLogOut(NSString* format, va_list valist) {
NSString* str = [[[NSString alloc] initWithFormat:format arguments:valist] autorelease];
[[str stringByAppendingString:@"\n"] writeToFile:@"/dev/stdout" atomically:NO encoding:NSUTF8StringEncoding error:nil];
}
void NSLogOut(NSString* format, ...) {
va_list valist;
va_start(valist, format);
NSString* str = [[[NSString alloc] initWithFormat:format arguments:valist] autorelease];
__NSLogOut(format, valist);
va_end(valist);
}
[[str stringByAppendingString:@"\n"] writeToFile:@"/dev/stdout" atomically:NO encoding:NSUTF8StringEncoding error:nil];
void NSLogVerbose(NSString* format, ...) {
if (verbose) {
va_list valist;
va_start(valist, format);
__NSLogOut(format, valist);
va_end(valist);
}
}
BOOL mkdirp(NSString* path) {
NSError* error = nil;
BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:path
withIntermediateDirectories:YES
attributes:nil
error:&error];
return success;
}
Boolean path_exists(CFTypeRef path) {
@@ -315,7 +255,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;
@@ -420,6 +360,11 @@ 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")
return model;
}
@@ -452,11 +397,8 @@ CFStringRef get_device_full_name(const AMDeviceRef device) {
device_name = AMDeviceCopyValue(device, 0, CFSTR("DeviceName")),
model_name = get_device_hardware_name(device);
if (verbose)
{
NSLogOut(@"Device Name: %@", device_name);
NSLogOut(@"Model Name: %@", model_name);
}
NSLogVerbose(@"Device Name: %@", device_name);
NSLogVerbose(@"Model Name: %@", model_name);
if(device_name != NULL && model_name != NULL)
{
@@ -594,10 +536,8 @@ void mount_developer_image(AMDeviceRef device) {
CFStringRef image_path = copy_developer_disk_image_path(device);
CFStringRef sig_path = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@.signature"), image_path);
if (verbose) {
NSLogOut(@"Device support path: %@", ds_path);
NSLogOut(@"Developer disk image: %@", image_path);
}
NSLogVerbose(@"Device support path: %@", ds_path);
NSLogVerbose(@"Developer disk image: %@", image_path);
CFRelease(ds_path);
FILE* sig = fopen(CFStringGetCStringPtr(sig_path, kCFStringEncodingMacRoman), "rb");
@@ -659,7 +599,7 @@ CFURLRef copy_device_app_url(AMDeviceRef device, CFStringRef identifier) {
CFDictionaryRef result = nil;
NSArray *a = [NSArray arrayWithObjects:
@"CFBundleIdentifier", // absolute must
@"CFBundleIdentifier", // absolute must
@"ApplicationDSID",
@"ApplicationType",
@"CFBundleExecutable",
@@ -684,7 +624,7 @@ CFURLRef copy_device_app_url(AMDeviceRef device, CFStringRef identifier) {
nil];
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:a forKey:@"ReturnAttributes"];
CFDictionaryRef options = (CFDictionaryRef)optionsDict;
CFDictionaryRef options = (CFDictionaryRef)optionsDict;
check_error(AMDeviceLookupApplications(device, options, &result));
@@ -702,7 +642,10 @@ CFURLRef copy_device_app_url(AMDeviceRef device, CFStringRef identifier) {
CFStringRef copy_disk_app_identifier(CFURLRef disk_app_url) {
CFURLRef plist_url = CFURLCreateCopyAppendingPathComponent(NULL, disk_app_url, CFSTR("Info.plist"), false);
CFReadStreamRef plist_stream = CFReadStreamCreateWithFile(NULL, plist_url);
CFReadStreamOpen(plist_stream);
if (!CFReadStreamOpen(plist_stream)) {
on_error(@"Cannot read Info.plist file: %@", plist_url);
}
CFPropertyListRef plist = CFPropertyListCreateWithStream(NULL, plist_stream, 0, kCFPropertyListImmutable, NULL, NULL);
CFStringRef bundle_identifier = CFRetain(CFDictionaryGetValue(plist, CFSTR("CFBundleIdentifier")));
CFReadStreamClose(plist_stream);
@@ -727,7 +670,7 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) {
CFStringFindAndReplace(cmds, CFSTR("{ds_path}"), ds_path, range, 0);
range.length = CFStringGetLength(cmds);
CFMutableStringRef pmodule = CFStringCreateMutableCopy(NULL, 0, LLDB_FRUITSTRAP_MODULE);
CFMutableStringRef pmodule = CFStringCreateMutableCopy(NULL, 0, (CFStringRef)LLDB_FRUITSTRAP_MODULE);
CFRange rangeLLDB = { 0, CFStringGetLength(pmodule) };
CFStringRef exitcode_app_crash_str = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), exitcode_app_crash);
@@ -735,7 +678,7 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) {
rangeLLDB.length = CFStringGetLength(pmodule);
if (args) {
CFStringRef cf_args = CFStringCreateWithCString(NULL, args, kCFStringEncodingASCII);
CFStringRef cf_args = CFStringCreateWithCString(NULL, args, kCFStringEncodingUTF8);
CFStringFindAndReplace(cmds, CFSTR("{args}"), cf_args, range, 0);
rangeLLDB.length = CFStringGetLength(pmodule);
CFStringFindAndReplace(pmodule, CFSTR("{args}"), cf_args, rangeLLDB, 0);
@@ -778,26 +721,27 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) {
CFStringRef disk_container_path = CFURLCopyFileSystemPath(disk_container_url, kCFURLPOSIXPathStyle);
CFStringFindAndReplace(cmds, CFSTR("{disk_container}"), disk_container_path, range, 0);
char python_file_path[300] = "/tmp/fruitstrap_";
char python_command[300] = "fruitstrap_";
NSString* python_file_path = [NSString stringWithFormat:@"/tmp/%@/fruitstrap_", tmpUUID];
mkdirp(python_file_path);
NSString* python_command = @"fruitstrap_";
if(device_id != NULL) {
strcat(python_file_path, device_id);
strcat(python_command, device_id);
python_file_path = [python_file_path stringByAppendingString:[NSString stringWithUTF8String:device_id]];
python_command = [python_command stringByAppendingString:[NSString stringWithUTF8String:device_id]];
}
strcat(python_file_path, ".py");
python_file_path = [python_file_path stringByAppendingString:@".py"];
CFStringRef cf_python_command = CFStringCreateWithCString(NULL, python_command, kCFStringEncodingASCII);
CFStringFindAndReplace(cmds, CFSTR("{python_command}"), cf_python_command, range, 0);
CFStringFindAndReplace(cmds, CFSTR("{python_command}"), (CFStringRef)python_command, range, 0);
range.length = CFStringGetLength(cmds);
CFStringRef cf_python_file_path = CFStringCreateWithCString(NULL, python_file_path, kCFStringEncodingASCII);
CFStringFindAndReplace(cmds, CFSTR("{python_file_path}"), cf_python_file_path, range, 0);
CFStringFindAndReplace(cmds, CFSTR("{python_file_path}"), (CFStringRef)python_file_path, range, 0);
range.length = CFStringGetLength(cmds);
CFDataRef cmds_data = CFStringCreateExternalRepresentation(NULL, cmds, kCFStringEncodingASCII, 0);
char prep_cmds_path[300] = PREP_CMDS_PATH;
if(device_id != NULL)
strcat(prep_cmds_path, device_id);
FILE *out = fopen(prep_cmds_path, "w");
CFDataRef cmds_data = CFStringCreateExternalRepresentation(NULL, cmds, kCFStringEncodingUTF8, 0);
NSString* prep_cmds_path = [NSString stringWithFormat:PREP_CMDS_PATH, tmpUUID];
if(device_id != NULL) {
prep_cmds_path = [prep_cmds_path stringByAppendingString:[NSString stringWithUTF8String:device_id]];
}
FILE *out = fopen([prep_cmds_path UTF8String], "w");
fwrite(CFDataGetBytePtr(cmds_data), CFDataGetLength(cmds_data), 1, out);
// Write additional commands based on mode we're running in
const char* extra_cmds;
@@ -815,9 +759,9 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) {
fwrite(extra_cmds, strlen(extra_cmds), 1, out);
fclose(out);
CFDataRef pmodule_data = CFStringCreateExternalRepresentation(NULL, pmodule, kCFStringEncodingASCII, 0);
CFDataRef pmodule_data = CFStringCreateExternalRepresentation(NULL, pmodule, kCFStringEncodingUTF8, 0);
out = fopen(python_file_path, "w");
out = fopen([python_file_path UTF8String], "w");
fwrite(CFDataGetBytePtr(pmodule_data), CFDataGetLength(pmodule_data), 1, out);
fclose(out);
@@ -833,8 +777,6 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) {
CFRelease(disk_container_url);
CFRelease(disk_container_path);
CFRelease(cmds_data);
CFRelease(cf_python_command);
CFRelease(cf_python_file_path);
}
CFSocketRef server_socket;
@@ -846,7 +788,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 +898,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;
@@ -1050,12 +992,15 @@ void launch_debugger(AMDeviceRef device, CFURLRef url) {
// this we setup a dummy pipe on stdin, so read() would block expecting "user's" input.
setup_dummy_pipe_on_stdin(pfd);
char lldb_shell[400];
sprintf(lldb_shell, LLDB_SHELL);
if(device_id != NULL)
strcat(lldb_shell, device_id);
NSString* lldb_shell;
NSString* prep_cmds = [NSString stringWithFormat:PREP_CMDS_PATH, tmpUUID];
lldb_shell = [NSString stringWithFormat:LLDB_SHELL, prep_cmds];
int status = system(lldb_shell); // launch lldb
if(device_id != NULL) {
lldb_shell = [lldb_shell stringByAppendingString: [NSString stringWithUTF8String:device_id]];
}
int status = system([lldb_shell UTF8String]); // launch lldb
if (status == -1)
perror("failed launching lldb");
@@ -1087,12 +1032,14 @@ void launch_debugger_and_exit(AMDeviceRef device, CFURLRef url) {
if (dup2(pfd[0],STDIN_FILENO) == -1)
perror("dup2 failed");
char lldb_shell[400];
sprintf(lldb_shell, LLDB_SHELL);
if(device_id != NULL)
strcat(lldb_shell, device_id);
int status = system(lldb_shell); // launch lldb
NSString* prep_cmds = [NSString stringWithFormat:PREP_CMDS_PATH, tmpUUID];
NSString* lldb_shell = [NSString stringWithFormat:LLDB_SHELL, prep_cmds];
if(device_id != NULL) {
lldb_shell = [lldb_shell stringByAppendingString:[NSString stringWithUTF8String:device_id]];
}
int status = system([lldb_shell UTF8String]); // launch lldb
if (status == -1)
perror("failed launching lldb");
@@ -1104,8 +1051,7 @@ void launch_debugger_and_exit(AMDeviceRef device, CFURLRef url) {
_exit(WEXITSTATUS(status));
} else if (pid > 0) {
child = pid;
if (verbose)
NSLogOut(@"Waiting for child [Child: %d][Parent: %d]\n", child, parent);
NSLogVerbose(@"Waiting for child [Child: %d][Parent: %d]\n", child, parent);
} else {
on_sys_error(@"Fork failed");
}
@@ -1159,8 +1105,6 @@ void read_dir(service_conn_t afcFd, afc_connection* afc_conn_p, const char* dir,
AFCConnectionOpen(afcFd, 0, &afc_conn_p);
}
NSLogOut(@"%@", [NSString stringWithUTF8String:dir]);
afc_dictionary* afc_dict_p;
char *key, *val;
int not_dir = 0;
@@ -1180,7 +1124,13 @@ void read_dir(service_conn_t afcFd, afc_connection* afc_conn_p, const char* dir,
AFCKeyValueClose(afc_dict_p);
if (not_dir) {
if (callback) (*callback)(afc_conn_p, dir, not_dir);
NSLogOut(@"%@", [NSString stringWithUTF8String:dir]);
} else {
NSLogOut(@"%@/", [NSString stringWithUTF8String:dir]);
}
if (not_dir) {
if (callback) (*callback)(afc_conn_p, dir, not_dir);
return;
}
@@ -1229,10 +1179,10 @@ service_conn_t start_house_arrest_service(AMDeviceRef device) {
on_error(@"Bundle id is not specified");
}
CFStringRef cf_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingASCII);
CFStringRef cf_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingUTF8);
if (AMDeviceStartHouseArrestService(device, cf_bundle_id, 0, &houseFd, 0) != 0)
{
on_error(@"Unable to find bundle with id: %@", bundle_id);
on_error(@"Unable to find bundle with id: %@", [NSString stringWithUTF8String:bundle_id]);
}
check_error(AMDeviceStopSession(device));
@@ -1242,9 +1192,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 == '/')
@@ -1258,7 +1208,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);
@@ -1301,7 +1251,7 @@ int app_exists(AMDeviceRef device)
check_error(AMDeviceValidatePairing(device));
check_error(AMDeviceStartSession(device));
CFStringRef cf_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingASCII);
CFStringRef cf_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingUTF8);
NSArray *a = [NSArray arrayWithObjects:@"CFBundleIdentifier", nil];
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:a forKey:@"ReturnAttributes"];
@@ -1316,7 +1266,7 @@ int app_exists(AMDeviceRef device)
check_error(AMDeviceStopSession(device));
check_error(AMDeviceDisconnect(device));
if (appExists)
return 0;
return 0;
return -1;
}
@@ -1326,22 +1276,21 @@ void list_bundle_id(AMDeviceRef device)
assert(AMDeviceIsPaired(device));
check_error(AMDeviceValidatePairing(device));
check_error(AMDeviceStartSession(device));
NSArray *a = [NSArray arrayWithObjects:@"CFBundleIdentifier", nil];
NSDictionary *optionsDict = [NSDictionary dictionaryWithObject:a forKey:@"ReturnAttributes"];
CFDictionaryRef options = (CFDictionaryRef)optionsDict;
CFDictionaryRef result = nil;
check_error(AMDeviceLookupApplications(device, options, &result));
CFIndex count;
count = CFDictionaryGetCount(result);
const void *keys[count];
CFDictionaryGetKeysAndValues(result, keys, NULL);
for(int i = 0; i < count; ++i) {
CFStringRef test = (CFStringRef)keys[i];
NSLogOut(@"%@", (CFStringRef)keys[i]);
}
check_error(AMDeviceStopSession(device));
check_error(AMDeviceDisconnect(device));
}
@@ -1355,45 +1304,36 @@ void copy_file_callback(afc_connection* afc_conn_p, const char *name,int file)
if (*local_name=='\0') return;
if (file) {
afc_file_ref fref;
int err = AFCFileRefOpen(afc_conn_p,name,1,&fref);
afc_file_ref fref;
int err = AFCFileRefOpen(afc_conn_p,name,1,&fref);
if (err) {
fprintf(stderr,"AFCFileRefOpen(\"%s\") failed: %d\n",name,err);
return;
}
FILE *fp = fopen(local_name,"w");
if (fp==NULL) {
fprintf(stderr,"fopen(\"%s\",\"w\") failer: %s\n",local_name,strerror(errno));
AFCFileRefClose(afc_conn_p,fref);
return;
}
char buf[4096];
size_t sz=sizeof(buf);
while (AFCFileRefRead(afc_conn_p,fref,buf,&sz)==0 && sz) {
fwrite(buf,sz,1,fp);
sz = sizeof(buf);
}
AFCFileRefClose(afc_conn_p,fref);
fclose(fp);
} else {
if (mkdir(local_name,0777) && errno!=EEXIST)
fprintf(stderr,"mkdir(\"%s\") failed: %s\n",local_name,strerror(errno));
if (err) {
fprintf(stderr,"AFCFileRefOpen(\"%s\") failed: %d\n",name,err);
return;
}
}
BOOL mkdirp(NSString* path) {
NSError* error = nil;
BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:path
withIntermediateDirectories:YES
attributes:nil
error:&error];
return success;
FILE *fp = fopen(local_name,"w");
if (fp==NULL) {
fprintf(stderr,"fopen(\"%s\",\"w\") failer: %s\n",local_name,strerror(errno));
AFCFileRefClose(afc_conn_p,fref);
return;
}
char buf[4096];
size_t sz=sizeof(buf);
while (AFCFileRefRead(afc_conn_p,fref,buf,&sz)==0 && sz) {
fwrite(buf,sz,1,fp);
sz = sizeof(buf);
}
AFCFileRefClose(afc_conn_p,fref);
fclose(fp);
} else {
if (mkdir(local_name,0777) && errno!=EEXIST)
fprintf(stderr,"mkdir(\"%s\") failed: %s\n",local_name,strerror(errno));
}
}
void download_tree(AMDeviceRef device)
@@ -1401,26 +1341,29 @@ void download_tree(AMDeviceRef device)
service_conn_t houseFd = start_house_arrest_service(device);
afc_connection* afc_conn_p = NULL;
char *dirname = NULL;
list_root = list_root? list_root : "/";
target_filename = target_filename? target_filename : ".";
NSString* targetPath = [NSString pathWithComponents:@[ @(target_filename), @(list_root)] ];
mkdirp([targetPath stringByDeletingLastPathComponent]);
if (AFCConnectionOpen(houseFd, 0, &afc_conn_p) == 0) do {
if (target_filename) {
dirname = strdup(target_filename);
mkdirp(@(dirname));
if (mkdir(dirname,0777) && errno!=EEXIST) {
fprintf(stderr,"mkdir(\"%s\") failed: %s\n",dirname,strerror(errno));
break;
}
if (chdir(dirname)) {
fprintf(stderr,"chdir(\"%s\") failed: %s\n",dirname,strerror(errno));
break;
}
}
if (target_filename) {
dirname = strdup(target_filename);
mkdirp(@(dirname));
if (mkdir(dirname,0777) && errno!=EEXIST) {
fprintf(stderr,"mkdir(\"%s\") failed: %s\n",dirname,strerror(errno));
break;
}
if (chdir(dirname)) {
fprintf(stderr,"chdir(\"%s\") failed: %s\n",dirname,strerror(errno));
break;
}
}
read_dir(houseFd, afc_conn_p, list_root?list_root:"/", copy_file_callback);
read_dir(houseFd, afc_conn_p, list_root, copy_file_callback);
} while(0);
@@ -1428,10 +1371,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;
@@ -1444,49 +1389,85 @@ 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: %@", 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);
afc_file_ref file_ref;
afc_connection afc_conn;
afc_connection* afc_conn_p = &afc_conn;
AFCConnectionOpen(houseFd, 0, &afc_conn_p);
@@ -1498,8 +1479,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);
@@ -1518,13 +1497,13 @@ void uninstall_app(AMDeviceRef device) {
CFStringRef cf_uninstall_bundle_id = NULL;
if (bundle_id != NULL)
{
cf_uninstall_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingASCII);
cf_uninstall_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingUTF8);
} else {
on_error(@"Error: you need to pass in the bundle id, (i.e. --bundle_id com.my.app)");
}
if (cf_uninstall_bundle_id == NULL) {
on_error(@"Error: Unable to get bundle id from user command or package %@.\nUninstall failed.", app_path);
on_error(@"Error: Unable to get bundle id from user command or package %@.\nUninstall failed.", [NSString stringWithUTF8String:app_path]);
} else {
AMDeviceConnect(device);
assert(AMDeviceIsPaired(device));
@@ -1543,20 +1522,19 @@ void uninstall_app(AMDeviceRef device) {
}
void handle_device(AMDeviceRef device) {
//if (found_device)
// return; // handle one device only
NSLogVerbose(@"Already found device? %d", found_device);
CFStringRef found_device_id = AMDeviceCopyDeviceIdentifier(device),
device_full_name = get_device_full_name(device),
device_interface_name = get_device_interface_name(device);
if (detect_only) {
NSLogOut(@"[....] Found %@ connected through %@.", device_full_name, device_interface_name);
found_device = true;
return;
}
if (device_id != NULL) {
CFStringRef deviceCFSTR = CFStringCreateWithCString(NULL, device_id, kCFStringEncodingASCII);
CFStringRef deviceCFSTR = CFStringCreateWithCString(NULL, device_id, kCFStringEncodingUTF8);
if (CFStringCompare(deviceCFSTR, found_device_id, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
found_device = true;
CFRelease(deviceCFSTR);
@@ -1577,7 +1555,7 @@ void handle_device(AMDeviceRef device) {
} else if (strcmp("upload", command) == 0) {
upload_file(device);
} else if (strcmp("download", command) == 0) {
download_tree(device);
download_tree(device);
} else if (strcmp("mkdir", command) == 0) {
make_directory(device);
} else if (strcmp("rm", command) == 0) {
@@ -1595,7 +1573,7 @@ void handle_device(AMDeviceRef device) {
CFRetain(device); // don't know if this is necessary?
CFStringRef path = CFStringCreateWithCString(NULL, app_path, kCFStringEncodingASCII);
CFStringRef path = CFStringCreateWithCString(NULL, app_path, kCFStringEncodingUTF8);
CFURLRef relative_url = CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, false);
CFURLRef url = CFURLCopyAbsoluteURL(relative_url);
@@ -1608,13 +1586,13 @@ void handle_device(AMDeviceRef device) {
CFStringRef cf_uninstall_bundle_id = NULL;
if (bundle_id != NULL)
{
cf_uninstall_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingASCII);
cf_uninstall_bundle_id = CFStringCreateWithCString(NULL, bundle_id, kCFStringEncodingUTF8);
} else {
cf_uninstall_bundle_id = get_bundle_id(url);
}
if (cf_uninstall_bundle_id == NULL) {
on_error(@"Error: Unable to get bundle id from user command or package %@.\nUninstall failed.", app_path);
on_error(@"Error: Unable to get bundle id from user command or package %@.\nUninstall failed.", [NSString stringWithUTF8String:app_path]);
} else {
AMDeviceConnect(device);
assert(AMDeviceIsPaired(device));
@@ -1698,8 +1676,17 @@ void device_callback(struct am_device_notification_callback_info *info, void *ar
switch (info->msg) {
case ADNCI_MSG_CONNECTED:
if(device_id != NULL || !debug || AMDeviceGetInterfaceType(info->dev) != 2) {
handle_device(info->dev);
if (no_wifi && AMDeviceGetInterfaceType(info->dev) == 2)
{
NSLogVerbose(@"Skipping wifi device (type: %d)", AMDeviceGetInterfaceType(info->dev));
}
else
{
NSLogVerbose(@"Handling device type: %d", AMDeviceGetInterfaceType(info->dev));
handle_device(info->dev);
}
} else if(best_device_match == NULL) {
NSLogVerbose(@"Best device match: %d", AMDeviceGetInterfaceType(info->dev));
best_device_match = info->dev;
CFRetain(best_device_match);
}
@@ -1711,6 +1698,7 @@ void device_callback(struct am_device_notification_callback_info *info, void *ar
void timeout_callback(CFRunLoopTimerRef timer, void *info) {
if ((!found_device) && (!detect_only)) {
if(best_device_match != NULL) {
NSLogVerbose(@"Handling best device match.");
handle_device(best_device_match);
CFRelease(best_device_match);
@@ -1733,10 +1721,7 @@ void timeout_callback(CFRunLoopTimerRef timer, void *info) {
int mypid = getpid();
if ((parent != 0) && (parent == mypid) && (child != 0))
{
if (verbose)
{
NSLogOut(@"Timeout. Killing child (%d) tree.", child);
}
NSLogVerbose(@"Timeout. Killing child (%d) tree.", child);
kill_ptree(child, SIGHUP);
}
}
@@ -1771,15 +1756,25 @@ void usage(const char* app) {
@" -R, --rm <path> remove file or directory on device (directories must be empty)\n"
@" -V, --version print the executable version \n"
@" -e, --exists check if the app with given bundle_id is installed or not \n"
@" -B, --list_bundle_id list bundle_id \n",
@" -B, --list_bundle_id list bundle_id \n"
@" -W, --no-wifi ignore wifi devices\n",
[NSString stringWithUTF8String:app]);
}
void show_version() {
NSLogOut(@"%@", APP_VERSION);
NSLogOut(@"%@", @
#include "version.h"
);
}
int main(int argc, char *argv[]) {
// create a UUID for tmp purposes
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef str = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
tmpUUID = [(NSString*)str autorelease];
static struct option longopts[] = {
{ "debug", no_argument, NULL, 'd' },
{ "id", required_argument, NULL, 'i' },
@@ -1806,11 +1801,12 @@ int main(int argc, char *argv[]) {
{ "rm", required_argument, NULL, 'R'},
{ "exists", no_argument, NULL, 'e'},
{ "list_bundle_id", no_argument, NULL, 'B'},
{ "no-wifi", no_argument, NULL, 'W'},
{ NULL, 0, NULL, 0 },
};
char ch;
while ((ch = getopt_long(argc, argv, "VmcdvunrILeD:R:i:b:a:t:g:x:p:1:2:o:l::w::9::B::", longopts, NULL)) != -1)
while ((ch = getopt_long(argc, argv, "VmcdvunrILeD:R:i:b:a:t:g:x:p:1:2:o:l::w::9::B::W", longopts, NULL)) != -1)
{
switch (ch) {
case 'm':
@@ -1833,7 +1829,7 @@ int main(int argc, char *argv[]) {
verbose = 1;
break;
case 't':
timeout = atoi(optarg);
_timeout = atoi(optarg);
break;
case 'u':
unbuffered = 1;
@@ -1906,6 +1902,9 @@ int main(int argc, char *argv[]) {
command_only = true;
command = "list_bundle_id";
break;
case 'W':
no_wifi = true;
break;
default:
usage(argv[0]);
return exitcode_error;
@@ -1922,29 +1921,28 @@ 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) {
if (access(app_path, F_OK) != 0) {
on_sys_error(@"Can't access app path '%@'", app_path);
on_sys_error(@"Can't access app path '%@'", [NSString stringWithUTF8String:app_path]);
}
}
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
{
NSLogOut(@"[....] Waiting for iOS device to be connected");
}
struct am_device_notification *notify;
AMDeviceNotificationSubscribe(&device_callback, 0, 0, NULL, &notify);
CFRunLoopRun();
}

1
src/ios-deploy/version.h Normal file
View File

@@ -0,0 +1 @@
"1.8.7"

56
src/scripts/check_reqs.js Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env node
var util = require('util');
var os = require('os');
var child_process = require('child_process');
var XCODEBUILD_MIN_VERSION = '6.0';
var XCODEBUILD_NOT_FOUND_MESSAGE = util.format('Please install Xcode version %s or greater from the Mac App Store.', XCODEBUILD_MIN_VERSION);
var TOOL = 'xcodebuild';
var xcode_version = child_process.spawn(TOOL, ['-version']),
version_string = '';
xcode_version.stdout.on('data', function (data) {
version_string += data;
});
xcode_version.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
xcode_version.on('error', function (err) {
console.log(util.format('Tool %s was not found. %s', TOOL, XCODEBUILD_NOT_FOUND_MESSAGE));
});
xcode_version.on('close', function (code) {
if (code === 0) {
var arr = version_string.match(/^Xcode (\d+\.\d+)/);
var ver = arr[1];
if (os.release() >= '15.0.0' && ver < '7.0') {
console.log(util.format('You need at least Xcode 7.0 when you are on OS X 10.11 El Capitan (you have version %s)', ver));
process.exit(1);
}
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);
});

83
src/scripts/lldb.py Normal file
View File

@@ -0,0 +1,83 @@
import lldb
import os
import sys
import shlex
def connect_command(debugger, command, result, internal_dict):
# These two are passed in by the script which loads us
connect_url = internal_dict['fruitstrap_connect_url']
error = lldb.SBError()
process = lldb.target.ConnectRemote(lldb.target.GetDebugger().GetListener(), connect_url, None, error)
# Wait for connection to succeed
listener = lldb.target.GetDebugger().GetListener()
listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged)
events = []
state = (process.GetState() or lldb.eStateInvalid)
while state != lldb.eStateConnected:
event = lldb.SBEvent()
if listener.WaitForEvent(1, event):
state = process.GetStateFromEvent(event)
events.append(event)
else:
state = lldb.eStateInvalid
# Add events back to queue, otherwise lldb freezes
for event in events:
listener.AddEvent(event)
def run_command(debugger, command, result, internal_dict):
device_app = internal_dict['fruitstrap_device_app']
args = command.split('--',1)
error = lldb.SBError()
lldb.target.modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))
args_arr = []
if len(args) > 1:
args_arr = shlex.split(args[1] and args[1] or '{args}')
lldb.target.Launch(lldb.SBLaunchInfo(args_arr), error)
lockedstr = ': Locked'
if lockedstr in str(error):
print('\\nDevice Locked\\n')
os._exit(254)
else:
print(str(error))
def safequit_command(debugger, command, result, internal_dict):
process = lldb.target.process
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
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.eStateExited:
os._exit(process.GetExitStatus())
elif state == lldb.eStateStopped:
debugger.HandleCommand('bt')
os._exit({exitcode_app_crash})
stdout = process.GetSTDOUT(1024)
while stdout:
sys.stdout.write(stdout)
stdout = process.GetSTDOUT(1024)
stderr = process.GetSTDERR(1024)
while stderr:
sys.stdout.write(stderr)
stderr = process.GetSTDERR(1024)