Coder Social home page Coder Social logo

ios-control / ios-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghughes/fruitstrap

3.3K 114.0 461.0 769 KB

Install and debug iPhone apps from the command line, without using Xcode

License: GNU General Public License v3.0

C 25.58% JavaScript 0.21% Python 3.06% Objective-C 70.79% Shell 0.07% Starlark 0.29%

ios-deploy's Introduction

Build Status

ios-deploy

Install and debug iOS apps from the command line. Designed to work on un-jailbroken devices running iOS versions prior to iOS17. iOS17 updated the System frameworks used to communicate with devices and Apple created their own command-line tools that can largely replace ios-deploy.

Requirements

  • macOS
  • You need to have a valid iOS Development certificate installed
  • Xcode (NOT just Command Line Tools!)

Tested Configurations

The ios-deploy binary in Homebrew should work on macOS 10.0+ with Xcode7+. It has been most recently tested with the following configurations:

  • macOS 10.14 Mojave, 10.15 Catalina and preliminary testing on 11.0b BigSur
  • iOS 13.0 and preliminary testing on iOS 14.0b
  • Xcode 11.3, 11.6 and preliminary testing on Xcode 12 betas
  • x86 and preliminary testing on Arm64e based Apple Macintosh Computers

Roadmap

See our milestones.

Development

The 1.x branch has been archived (renamed for now), all development is to be on the master branch for simplicity, since the planned 2.x development (break out commands into their own files) has been abandoned for now.

Installation

If you have previously installed ios-deploy via npm, uninstall it by running:

sudo npm uninstall -g ios-deploy

Install ios-deploy via Homebrew by running:

brew install ios-deploy

Testing

Run:

python -m py_compile src/scripts/*.py && xcodebuild -target ios-deploy && xcodebuild test -scheme ios-deploy-tests

Usage

Usage: ios-deploy [OPTION]...
  -d, --debug                  launch the app in lldb after installation
  -i, --id <device_id>         the id of the device to connect to
  -c, --detect                 list all connected devices
  -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
  -s, --envs <envs>            environment variables, space separated key-value pairs, 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
  -N, --nolldb                 start debugserver only. do not run lldb. Can not be used with args or envs options
  -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)
  -A, --app_deltas             incremental install. must specify a directory to store app deltas to determine what needs to be installed
  -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[=<dir>]           list all app files or the specified directory
  -o, --upload <file>          upload file
  -w, --download[=<path>]      download app tree or the specified file/directory
  -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)
  -X, --rmtree <path>          remove directory and all contained files recursively on device
  -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
  -C, --get_battery_level      get battery current capacity
  -O, --output <file>          write stdout to this file
  -E, --error_output <file>    write stderr to this file
  --detect_deadlocks <sec>     start printing backtraces for all threads periodically after specific amount of seconds
  -f, --file_system            specify file system for mkdir / list / upload / download / rm
  -F, --non-recursively        specify non-recursively walk directory
  -S, --symbols                download OS symbols. must specify a directory to store the downloaded symbols
  -j, --json                   format output as JSON
  -k, --key                    keys for the properties of the bundle. Joined by ',' and used only with -B <list_bundle_id> and -j <json>
  --custom-script <script>     path to custom python script to execute in lldb
  --custom-command <command>   specify additional lldb commands to execute
  --faster-path-search         use alternative logic to find the device support paths faster
  -P, --list_profiles          list all provisioning profiles on device
  --profile-uuid <uuid>        the UUID of the provisioning profile to target, use with other profile commands
  --profile-download <path>    download a provisioning profile (requires --profile-uuid)
  --profile-install <file>     install a provisioning profile
  --profile-uninstall          uninstall a provisioning profile (requires --profile-uuid <UUID>)
  --check-developer-mode       checks whether the given device has developer mode enabled (Requires Xcode 14 or newer)

Examples

The commands below assume that you have an app called my.app with bundle id bundle.id. Substitute where necessary.

// deploy and debug your app to a connected device
ios-deploy --debug --bundle my.app

// deploy, debug and pass environment variables to a connected device
ios-deploy --debug --envs DYLD_PRINT_STATISTICS=1 --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

// deploy and launch your app to a connected device, quit when app crashes or exits
ios-deploy --noninteractive --debug --bundle my.app

// deploy your app to a connected device using incremental installation
ios-deploy --app_deltas /tmp --bundle my.app

// Upload a file to your app's Documents folder
ios-deploy --bundle_id 'bundle.id' --upload test.txt --to Documents/test.txt

// Download your app's Documents, Library and tmp folders
ios-deploy --bundle_id 'bundle.id' --download --to MyDestinationFolder

// List the contents of your app's Documents, Library and tmp folders
ios-deploy --bundle_id 'bundle.id' --list

// deploy and debug your app to a connected device, uninstall the app first
ios-deploy --uninstall --debug --bundle my.app

// check whether an app by bundle id exists on the device (check return code `echo $?`)
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

// List ids and names of connected devices
ios-deploy -c

// Uninstall an app
ios-deploy --uninstall_only --bundle_id my.bundle.id

// list all bundle ids of all apps on your device
ios-deploy --list_bundle_id

// list the files in cameral roll, a.k.a /DCIM
ios-deploy -f -l/DCIM

// download the file in /DCIM
ios-deploy -f -w/DCIM/100APPLE/IMG_001.jpg

// remove the file /DCIM
ios-deploy -f -R /DCIM/100APPLE/IMG_001.jpg

// make directoly in /DCIM
ios-deploy -f -D/DCIM/test

// upload file to /DCIM
ios-deploy -f -o/Users/ryan/Downloads/test.png -2/DCIM/test.png

// get more properties of the bundle
ios-deploy -B -j --key=UIFileSharingEnabled,CFBundlePackageType
ios-deploy -B -j --key=UIFileSharingEnabled --key=CFBundlePackageType

Demo

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 debug will install demo.app and launch a LLDB session.

Notes

  • --detect_deadlocks can help to identify an exact state of application's threads in case of a deadlock. It works like this: The user specifies the amount of time ios-deploy runs the app as usual. When the timeout is elapsed ios-deploy starts to print call-stacks of all threads every 5 seconds and the app keeps running. Comparing threads' call-stacks between each other helps to identify the threads which were stuck.

License

ios-deploy is available under the provisions of the GNU General Public License, version 3 (or later), available here: http://www.gnu.org/licenses/gpl-3.0.html

Error codes used for error messages were taken from SDMMobileDevice framework, originally reverse engineered by Sam Marshall. SDMMobileDevice is distributed under BSD 3-Clause license and is available here: https://github.com/samdmarshall/SDMMobileDevice

ios-deploy's People

Contributors

ahmadtawakol avatar akofman avatar alexmipego avatar antoinevg avatar black-square avatar christopherfujino avatar dwarfland avatar eddieh avatar eunikolsky avatar gabebear avatar ghughes avatar incont avatar ivanhernandez13 avatar jakepetroules avatar linusu avatar luser avatar mattcenturion avatar neoalienson avatar nisargjhaveri avatar perchrh avatar ptc-shunt avatar pvinis avatar reidhoch avatar ryanluoo avatar ryanthered avatar senthilmanick avatar shazron avatar ukalnins avatar wjywbs avatar zgramana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-deploy's Issues

Assertion failed AMDeviceSecureTransferPath (app name has non-ASCII characters)

Hi,

I already tried to run my app on device with ios-deploy and it worked but now I have this error.

Assertion failed: (AMDeviceSecureTransferPath(0, device, url, options, transfer_callback, 0)==0), function handle_device, file ios-deploy.c, line 1269.
Abort trap: 6

I already clean the project using "xcodebuild clean" but no result.

I try to run my app on an Ipod touch 5g and an iPad, I got the same error

Any idea?

AMDeviceInstallApplication failed: -402620388

Can't deploy to a device. Installation stops at "VerifyingApplication", returning AMDeviceInstallApplication failed: -402620388

$ ios-deploy -d -i  -b ~/project/Frankified.app -v
------ Install phase ------
[....] Waiting for iOS device to be connected
[  0%] Found device (...), beginning install
...
[ 52%] CreatingStagingDirectory
[ 57%] ExtractingPackage
[ 60%] InspectingPackage
[ 60%] TakingInstallLock
[ 65%] PreflightingApplication
[ 70%] VerifyingApplication
AMDeviceInstallApplication failed: -402620388

Args not passed.

So I was noticing that it seems like the arguments were not being passed through after the changes to use lldb. Was there a fix planned for this.

Also noticed in testing that we were having issues launching apps on older iphone4's running 6.1.3 OS. Very inconsistent, sometimes the app would launch and hang immediately. Anyone else seeing the same issues?

Problem with device detection on iOS8 GM seed

ios-deploy does not visible device (iPhone 5C) with iOS8 GM seed:

tester$ ios-deploy -c
[....] Waiting up to 5 seconds for iOS device to be connected
[....] Found (null) connected through USB.

idevice_id (from libimobiledevice) works.

lldb console spammed with quit attempts, app hangs without running

v1.0.6
Using --verbose, --debug, --nointeractive and --unbuffered.
Might be multiple issues going on here.

------ Debug phase ------
Device support path: /Users/me/Library/Developer/Xcode/iOS DeviceSupport/7.0.4 (11B554a)
Developer disk image: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/7.1 (11D167)/DeveloperDiskImage.dmg
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
tcsetpgrp failed: Inappropriate ioctl for device
^D
^D
^D
^D
^D
^D
^D
quit
quit
qu(lldb) quit
quit
[ ... some pages later ... ]
quit
quit
quit^D
qusuccess
Executing commands in '/tmp/fruitstrap-lldb-prep-cmds-'.
(lldb) platform select remote-ios --sysroot '/Users/me/Library/Developer/Xcode/iOS DeviceSupport/7.0.4 (11B554a)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/me/Library/Developer/Xcode/iOS DeviceSupport/7.0.4 (11B554a)/Symbols"
(lldb) target create "MyApp.app"
Current executable set to 'MyApp.app' (armv7).
(lldb) script fruitstrap_device_app="/private/var/mobile/Applications/442DB2EB-C55B-47AC-8B8E-9DD449A51E29/MyApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:12345"
(lldb) command script import "/tmp/fruitstrap_.py"
(lldb) command script add -f fruitstrap_.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_.run_command run
(lldb) connect
(lldb) settings set -- auto-confirm true
(lldb) target stop-hook add --one-liner "bt"
Stop hook #1 added.
(lldb) target stop-hook add --one-liner "quit"
Stop hook #2 added.
(lldb) run

The app then does not run, and ios-deploy hangs indefinitely.

Clean exit from a device run

Whenever I deploy to my ios device via cordova run ios or other commands, I would always end up quitting by ctrl+c, look for ios-deploy process running, and then kill it. There has to be a cleaner way to do this.

iOS 7 Support?

Has there been any movement that you know of regarding support with the new Xcode/iOS builds? I haven't been able to find anything in the ios-deploy/fruitstrap network graph.

Problem with XCode 6.1 and iOS 8.1

I just updated XCode to 6.1 ( final version). I also updated phonegap iOS platform to version 3.6.0-0.21.19.

I can't build the XCode project anymore. I'm obtaining the following error:

154:19: error: no visible @interface for 'CDVCommandDelegateImpl' declares the selector 'execute:'
return [super execute:command];
~~~~~ ^~~~~~~
1 error generated.

Any idea?

Publish 1.1.0 version

  1. Update ios_deploy.c APP_VERSION macro
  2. Update version in package.json
  3. Update README.md help

Running app on iOS device fails

Running the following command "cordova run ios" to deploy app directly to iOS device.

The application builds successfully but has problems when trying to copy it over to device. On the "VerifyingApplication" step, getting following error: "AMDeviceInstallApplication failed: 0xE8008016: Unknown error."

Problems running app with XCode 6 GM

Since updating to XCode 6 GM I haven't been able to launch the app. It seems to get hung after the connect command.

[....] Waiting for iOS device to be connected
------ Debug phase ------
Starting debug of Unknown Device 'iPad3 7.1.2' (3fa1110751e326dc33266ead6698fe1d4be81d84) connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted

[100%] Connecting to remote debug server

(lldb) command source -s 0 '/tmp/fruitstrap-lldb-prep-cmds-3fa1110751e326dc33266ead6698fe1d4be81d84'
Executing commands in '/private/tmp/fruitstrap-lldb-prep-cmds-3fa1110751e326dc33266ead6698fe1d4be81d84'.
(lldb) platform select remote-ios --sysroot '/Users/username/Library/Developer/Xcode/iOS DeviceSupport/7.1.2 (11D257)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/username/Library/Developer/Xcode/iOS DeviceSupport/7.1.2 (11D257)/Symbols"
(lldb) target create "/Users/username/git/application/ios/MyApp/DerivedData/MyApp/Build/Products/Automation-iphoneos/MyAppQA.app"
Current executable set to '/Users/username/git/application/ios/MyApp/DerivedData/MyApp/Build/Products/Automation-iphoneos/MyAppQA.app' (armv7).
(lldb) script fruitstrap_device_app="/private/var/mobile/Applications/FB5B092C-4AC9-45AA-8F6F-2366341E91C0/MyAppQA.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:44359"
(lldb) command script import "/tmp/fruitstrap_3fa1110751e326dc33266ead6698fe1d4be81d84.py"
(lldb) command script add -f fruitstrap_3fa1110751e326dc33266ead6698fe1d4be81d84.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_3fa1110751e326dc33266ead6698fe1d4be81d84.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_3fa1110751e326dc33266ead6698fe1d4be81d84.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_3fa1110751e326dc33266ead6698fe1d4be81d84.safequit_command safequit
(lldb) connect
Process 0 connected

Interestingly I'm able to run using an extremely old version of ios-deploy, although there is the 60 second delay before launch.

------ Install phase ------
[....] Waiting for iOS device to be connected
------ Debug phase ------
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted

[100%] Connecting to remote debug server

(lldb) command source -s 0 '/tmp/fruitstrap-lldb-prep-cmds-3fa1110751e326dc33266ead6698fe1d4be81d84'
Executing commands in '/private/tmp/fruitstrap-lldb-prep-cmds-3fa1110751e326dc33266ead6698fe1d4be81d84'.
(lldb) platform select remote-ios --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/*
Platform: remote-ios
Connected: no
SDK Path: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/*"
(lldb) target create "/Users/username/git/application/ios/MyApp/DerivedData/MyApp/Build/Products/Automation-iphoneos/MyAppQA.app"
Current executable set to '/Users/username/git/application/ios/MyApp/DerivedData/MyApp/Build/Products/Automation-iphoneos/MyAppQA.app' (armv7).
(lldb) script fruitstrap_device_app="/private/var/mobile/Applications/FB5B092C-4AC9-45AA-8F6F-2366341E91C0/MyAppQA.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:15440"
(lldb) command script import "/tmp/fruitstrap3fa1110751e326dc33266ead6698fe1d4be81d84.py"
Process 0 connected
(lldb) pro hand -p false -s false -n false SIGPIPE
NAME PASS STOP NOTIFY
========== ===== ===== ======
SIGPIPE false false false
(lldb) run
success
Process 5604 stopped

  • thread #1: tid = 0x2d2a71, 0x2beac028 dyld_dyld_start, stop reason = shared-library-event frame #0: 0x2beac0cc dyldgdb_image_notifier
    dyld`gdb_image_notifier:
    -> 0x2beac0cc: bx lr

dyld`dyldbootstrap::start(macho_header const_, int, char const__, long, macho_header const_, unsigned long*):
0x2beac0d0: push {r4, r5, r6, r7, lr}
0x2beac0d2: add r7, sp, #0xc
0x2beac0d4: push.w {r8, r10, r11}
(lldb) 2014-09-15 15:47:13.156 MyAppQA[5604:60b] MyApp (MyAppDelegate): application:didFinishLaunchingWithOptions:(null)

(lldb) 2014-09-15 15:47:13.891 MyAppQA[5604:60b] MyAppSDK (UIWebView+LocalStorageLocation): sandbox rootPath /var/mobile/Applications/FB5B092C-4AC9-45AA-8F6F-2366341E91C0

LLDB invalid target

My command line is

./ios-deploy -d -b myappnamehere.app

I get

------ Debug phase ------
[  0%] Looking up developer disk image
[ 30%] Copying DeveloperDiskImage.dmg to device
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) run
error: invalid target, create a debug target using the 'target create' command

LLDB not getting input

When I run the command, I get the prompt for lldb, but when I try to use it, nothing happens, ala:

(lldb) qwerasdf

Expecting to see an error message.

My main goal is to run a dlopen command to load an xctest bundle. I tried modifying LLDB_FRUITSTRAP_MODULE, but when I ran it after the target was launched I got an obscure error message:

error: Didn't get any event after resume 1, exiting.Couldn't execute function; result was eExecutionSetupError

Any thoughts?

How do you get github/ios-deploy-master up and running for Cordova CLI?

If you try Cordova CLI's "cordova run ios" command on your PhoneGap project, you'll get an error along with a couple of resources to try in order to set it up for working:

Error: An error occurred while running the ios project.Error: ios-deploy was not found. Please download, build and install version 1.0.4 or greater from https://github.com/phonegap/ios-deploy into your path. Or 'npm install -g ios-deploy' using node.js: http://nodejs.org/

One way is through a GitHub download option. To get it working through the GitHub option, I tried following these steps:

  1. Go to GitHub and click on the Download ZIP button (at right): https://github.com/phonegap/ios-deploy I used Chrome and unzipped the file by clicking on the name in the lower left of the window.
  2. View the folder "ios-deploy-master" in Finder's Downloads folder, and drag it to its final location.
  3. To record that location, drag it to the terminal and note what it says. Mine said, /Users/Steve/Documents/PhoneGap_apps/ios-deploy-master
  4. We need to add that PATH statement to .profile. Type this in the terminal to check out what paths you have recorded so far: sudo pico /etc/paths
  5. You’ll see a listing of paths. Copy/paste the path to your /ios-deploy-master folder to the top and press Return so it's on its own line.
  6. The bottom of the screen tells us how to exit the page: Control-X, then Y for yes to save, then hitting Return returns us to the terminal.
  7. Now cd to the app's folder, then build the app with: cordova build
  8. Copy the .app file created in platforms/ios/build/device/include/ to ios-deploy-master and run: ios-deploy -d -v AppName.app

This command does not run. I don't know what step is wrong or missing to make this work.

Update README with new help text

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
  -g, --gdbargs <args>         extra arguments to pass to GDB when starting the debugger
  -x, --gdbexec <file>         GDB commands script file
  -n, --nostart                do not start the app when debugging
  -I, --noninteractive         start in non interactive mode (quit when app crashes or exits)
  -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) 
  -1, --bundle_id <bundle id>  specify bundle id for list and upload
  -l, --list                   list files
  -o, --upload <file>          upload file
  -2, --to <target pathname>    use together with upload file. specify target for upload
  -V, --version                print the executable version 

lldb not closing automatically

Running ./ios-deploy -d -i <UDID> -b ~/path/to/foobar.app successfully completes the "Install phase" and "Debug phase" but after

(lldb) run
success

lldb simply hangs. Even if I type quit, the debugger do not exit and I'm forced to do Ctrl+C.

AMDeviceValidatePairing fails when uninstalling

Without uninstall seems to work ok (apart from when #11 happens).
Adding --uninstall hits this assertion:

$ ios-deploy --verbose --bundle test.app --uninstall --debug --noninteractive --unbuffered --args 1
[....] Waiting for iOS device to be connected
------ Uninstall phase ------
Assertion failed: (AMDeviceValidatePairing(device) == 0), function handle_device, file ios-deploy.c, line 889.

iOS 8 Support

Any word on Xcode 6/iOS 8 support in ios-deploy?

I've got both Xcode 5 and Xcode 6 beta installed. Not sure if it's related but deploying a bundle to device runs just fine but fails to actually mount the disk image, so the debugger is useless.

Update: managed to get the debugger to mount the disk image. I forgot I'd also had the same problem before Xcode 6 beta. Closing for now. I'll reopen if I discover what I find to be any iOS 8 related bugs.

Wont work on Xcode 4.6.2

Xcode is now installed in a different location than where ios-deploy looks.

I did make it work hardcoding the paths to the developerdiskimage and the arm gdb binary, but it would be better if the script could find them automatically obviously.

When the device is locked, ios-deploy hangs

As stated in summary, if the connected iOS device is locked, the launcher fails and hence lldb hangs The issue is in run command.
Will submit a pull request

sw_vers: 10.9.4
ios-deploy: 1.0.9
Xcode 5.1.1
Build version 5B1008
/Applications/Xcode.app/Contents/Developer

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

lldb --version
lldb-310.2.37

Working fine through shell, but not through script....

First off thanks for maintaining this project, it has been a major help. I am developing a automated testing framework and need to install then run iOS apps on device and this tool meets my needs perfectly. I have it working fine through the command line

./iosdeploy -d -b .....my-app.ipa

It installs and runs the app on device correctly. However, when I script this call the tool hangs. Specifically lldb hangs with the call to

lldb.target.Launch(lldb.SBLaunchInfo(['{args}']),error)

The script i am running is the exact same as the command entered into terminal

! /usr/bin/bash

./iosdeploy -d -b .....my-app.ipa

I have checked the environment for both invocations and also the internal_dict for lldb and there is no difference except for the variable "SHLVL" which is expected.

I am running OS X 10.9.2 with XCode 5.1, everything is up to date as of this post. Any help on this issue will be much appreciated.

Cheers,
Fergus

Is it possible to run on multiple devices?

Hello,

I was wondering if it was possible to simultaneously run apps on mutliple devices using this tool, either attached to the debugger or not. I have some custom automated tests that I would like to kick off on several iPads at once, and it works great on a single device using the following arguments:

./ios-deploy -i {device id} -b <bundle.app> -d

or

./ios-deploy -i {device id} -b <bundle.app> -d -L

When I try to do that on multiple devices though (either by calling a script that sets off several ios-deploys in parallel or by manually entering in the commands in to separate prompts, I'm able to deploy to all the devices but only the first device ever starts the app. Is this a known limitation? Or is there any way around it? It looks like I may be able to use ios-deploy to install the app and then Apple's instruments command line interface to launch it with an empty automation script, but I thought I would ask here if there was another way. Ideally I would like to have debug output for every device running, but I would be fine without it as well.

On a related note, is it possible to start an app that is not built for debugging (ie, one signed with an enterprise adhoc certificate, or one downloaded from the App Store)?

Here is my system information in case it is helpful. Thanks!

sw_vers
ProductName: Mac OS X
ProductVersion: 10.9.4
BuildVersion: 13E28

ios-deploy -V
1.1.0

xcodebuild -version
Xcode 5.1.1
Build version 5B1008

xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

lldb --version
lldb-310.2.37

Add support for IPA files with --uninstall

Would it be possible to add support for running ios-deploy --uninstall with a .IPA file?

I'm running this to install an application, with the --uninstall to remove it first...
./ios-deploy --uninstall -b Debug-Release-4.3.ipa

The install works fine, but the uninstall fails with this...

------ Uninstall phase ------
Error: Unable to get bundle id from package Debug-Release-4.3.ipa

The work-around is to extract the IPA file and then run the same command against the extracted .APP folder instead, but it would be good if it worked with IPA off the bat... unless I'm doing something wrong.

Cheers
Joe

Feature request: ability to detect whether iOS device is locked

ios-deploy --detect indicates whether a device is connected, but not if the device is locked.
ios-deploy --debug fails with error 254 if it is unable to launch the app because they device is locked, but it would be nice to be able to detect a locked device in advance of actually deploying.

Installation problem

This is what happens:

$ sudo npm install -g ios-deploy

npm http GET https://registry.npmjs.org/ios-deploy
npm http 304 https://registry.npmjs.org/ios-deploy

[email protected] preinstall /usr/local/lib/node_modules/ios-deploy
make ios-deploy

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
make: getcwd: Permission denied
rm -rf .app demo ios-deploy
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
gcc -o ios-deploy -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
clang: error: unable to make temporary file: /usr/local/lib/node_modules/ios-deploy/ios-deploy: can't make unique filename: Permission denied
make: *
* [ios-deploy] Error 1
npm ERR! [email protected] preinstall: make ios-deploy
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make ios-deploy
npm ERR! You can get their info via:
npm ERR! npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! cwd /Users/hugoingelmo
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/hugoingelmo/npm-debug.log
npm ERR! not ok code 0

ERROR: Assertion Failed

I get the following error whenever I try to deploy anything to a device:

Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL) == 0), function start_remote_debug_server, file ios-deploy.c, line 524.

/Developer/Projects/Pathem/App/Platforms/ios/cordova/run: line 125: 15533 Abort trap: 6 ios-deploy -d -b "$DEVICE_APP_PATH"

I'm using the most recent version of ios-deploy and cordova (3.1.0).

Lots of C errors while running make ios-deploy

While running the NPM install command, i get the following errors;

$ sudo npm install -g ios-deploy
|
> [email protected] preinstall /usr/local/lib/node_modules/ios-deploy
> make ios-deploy

rm -rf *.app demo ios-deploy
gcc -ObjC -g -o ios-deploy -framework Foundation -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:146,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:38,
                 from ios-deploy.c:3:
/usr/include/MacTypes.h: In function ‘Debugger’:
/usr/include/MacTypes.h:693: error: expected declaration specifiers before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:705: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:752: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:764: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:776: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_10_8’
/usr/include/MacTypes.h:786: error: expected declaration specifiers before ‘#pragma’
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:38,
                 from ios-deploy.c:3:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:405: error: storage class specified for parameter ‘CFTypeID’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:406: error: storage class specified for parameter ‘CFOptionFlags’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:407: error: storage class specified for parameter ‘CFHashCode’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:408: error: storage class specified for parameter ‘CFIndex’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:412: error: storage class specified for parameter ‘CFTypeRef’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:414: error: storage class specified for parameter ‘CFStringRef’
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:415: error: storage class specified for parameter ‘CFMutableStringRef’

This continues to likes 10.000 lines with these kind of syntax errors.

Running it on a OSX 10.8.5 machine.

Is there a way to write/upload a file to OSX filesystem?

In my unit tests that I automate with ios-deploy, I'm looking for a way to generate a file on the iOS, and have it somehow stored on the OSX filesystem e.g. in the working directory where I launched ios-deploy from. Is something like that possible?

If not, I could always spawn up a HTTP server on the host, and have the iOS device HTTP upload the file there, but that's somewhat heavyweight. It would be nice if there was some way to achieve this with ios-deploy.

On Android I have the application write a file to the Android filesystem /sdcard/ directory, and then use adb pull to retrive that file to the OSX file system after the application has finished running. Would it be possible to do something like this with ios-deploy?

"Error: the platform is not currently connected" with XCode 5.1

I think this has to do with lldb being updated:

lldb --version
lldb-310.2.36

My error message is as follows:

(lldb) run
Executing commands in '/tmp/fruitstrap-lldb-prep-cmds-'.
(lldb) platform select remote-ios --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/*
Platform: remote-ios
Connected: no
SDK Path: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/*"
(lldb) target create "/Users/jkingyens/recur/platforms/ios/build/device/Recur.app"
Current executable set to '/Users/jkingyens/recur/platforms/ios/build/device/Recur.app' (armv7).
(lldb) script fruitstrap_device_app="/private/var/mobile/Applications/6D53CF72-AD0D-4632-AB4E-DB75A8DB2B03/Recur.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:12345"
(lldb) script fruitstrap_handle_command="command script add -s asynchronous -f fruitstrap_.fsrun_command run"
(lldb) command script import "/tmp/fruitstrap_.py"
error: the platform is not currently connected

Autorun xctests after deployment?

In xcode 4.x you were able to build with TEST_AFTER_BUILD=YES flag and subsequently deploy using fruitstrap and my tests would launch. I haven't seen a way to do this here...any ideas?

Add option to obtain ipa without deployment

In our continous delivery process would be amazing if this tool would just build and sign the .ipa and not actually send it to any device.
e.g.

--save path/to/new.ipa --nostart --nodebug

Can you please implement it?

Thank you!!

Request: exit after application exits

To allow fully-autonomous running of programs, can you add an option to exit lldb after the iOS application terminates.
At the moment we just have the hack of "wait a bit, then kill it".

shasum check failed during installation

Hello,

I try to install the last version with:

sudo npm install -g ios-deploy

But I have an error:

npm http GET https://registry.npmjs.org/ios-deploy
npm http 304 https://registry.npmjs.org/ios-deploy
npm http GET https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.7.tgz
npm http 200 https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.7.tgz
npm ERR! Error: shasum check failed for /Users/josejuan/tmp/npm-4666-vtY7t0Qx/1399933938840-0.04932064074091613/tmp.tgz
npm ERR! Expected: 24993073833b539b3cb155af2461c348e0ecdd37
npm ERR! Actual: 2853ca48b79bae24d6f5d456fdfcb97af51a558f
npm ERR! From: https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.0.7.tgz
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream. (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:919:16
npm ERR! at process._tickCallback (node.js:419:13)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! cwd /Volumes/DATOS/datos/proyectos/Android/Workspace/cordova_sample/app/hello
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/DATOS/datos/proyectos/Android/Workspace/cordova_sample/app/hello/npm-debug.log
npm ERR! not ok code 0

If I try:

sudo npm install -g [email protected]

All works fine.

What's the problem?

Thanks in advance

Application not updated

Hello,

I'm using ios-deploy to deploy my app, but it will never update my existing app. I have to remove the app prior running ios-deploy.
I haven't seen any option to update the app, this is how I'm using it:

ios-deploy -d `system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}' | head -n 1` -b `ls -t builds/App*ipa | head -n 1` -v

I made sure that the file is correct, I can see console logs from the device, but there are no errors there. The same line fired when I remove the app manually from the device will update it fine.

iOS 6.1.4

Debugging hungs up

When I try to run my cordova application in iOS simulator "cordova emulate ios"
I always get a hang up in debug phase:

[ 90%] SandboxingApplication
[100%] Installed package /Users/makarov/projects/ironworld/platforms/ios/build/device/IronWorld.app
------ Debug phase ------
[  0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) ^Drun
^D
^C
^D
^C

It doesn't start an emulator. I tried to wait some time, but no lucky. I even can't stop this process Ctrl-C doesn't work.

$ cordova --version
3.5.0-0.2.4
$ npm --version
1.4.16
$ node --version
v0.10.29
$ ios-deploy --version
1.0.8

Problems installing with npm (Xcode 6)

sudo npm install -g ios-deploy
npm http GET https://registry.npmjs.org/ios-deploy
npm http 304 https://registry.npmjs.org/ios-deploy

[email protected] preinstall /usr/local/lib/node_modules/ios-deploy
make ios-deploy

rm -rf .app demo ios-deploy
gcc -ObjC -g -o ios-deploy -framework Foundation -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
cc1: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
make: *
* [ios-deploy] Error 1
npm ERR! [email protected] preinstall: make ios-deploy
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! make ios-deploy
npm ERR! You can get their info via:
npm ERR! npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! cwd /Users/tobias
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/tobias/npm-debug.log
npm ERR! not ok code 0

Can anyone help ? I habe XCode 6 beta installed - Is this causing this issue ?

Problem with launching app on XCode 6.1 (iOS8)

There are no way to start app on iOS8 with new XCode 6.1.
ios-deploy version: 1.2.0

Message:
[....] Waiting for iOS device to be connected
------ Debug phase ------
Starting debug of iPhone 4S 'ip11' (<device_id>) connected through USB...
Device support path: /Users/tester/Library/Developer/Xcode/iOS DeviceSupport/8.0.2 (12A405)
Developer disk image: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/8.1 (12B411)/DeveloperDiskImage.dmg
[  0%] Looking up developer disk image
[ !! ] Unable to mount developer disk image. (e8000033)

Launch app without debugger

Is it possible to launch an app after installing it without keeping lldb open? The non interactive mode only quits when application exits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.