ios-control / ios-sim Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jhaynie/iphonesim
Command-line application launcher for the iOS Simulator
License: Apache License 2.0
This project forked from jhaynie/iphonesim
Command-line application launcher for the iOS Simulator
License: Apache License 2.0
With XCode 4.3 the tool doesn't work:
/usr/local/bin/ios-sim launch Tests.app, --family iphone
dyld: Library not loaded: @rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
Reason: image not found
Fixed in my Pull request #18
Not sure when this got introduced (I'll try to look at it further this weekend), but it appears that running a brew install ios-sim
has Xcode in the wrong place. It should be in /Applications/Xcode.app
.
xcodebuild -project ios-sim.xcodeproj -configuration Release SYMROOT=build
(in /private/tmp/ios-sim-bleD/phonegap-ios-sim-68a7604)
xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory)
mkdir -p /usr/local/Cellar/ios-sim/1.5.1/bin
cp build/Release/ios-sim /usr/local/Cellar/ios-sim/1.5.1/bin
rake aborted!
No such file or directory - build/Release/ios-sim
/private/tmp/ios-sim-bleD/phonegap-ios-sim-68a7604/Rakefile:15
(See full trace by running task with --trace)
HOMEBREW_VERSION: 0.9.3
HEAD: a2ea7da6031bb60a8ab5d95b79d57ecec50ca2fc
CPU: 8-core 64-bit sandybridge
OS X: 10.8-x86_64
Xcode: 4.5
CLT: 4.5.0.0.1.1249367152
X11: N/A
After upgrade to Xcode 5 I cannot start MobileSafari from command line. It worked with Xcode 4:
ios-sim launch /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Applications/MobileSafari.app --args -u http://google.com
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "iOS Simulator failed to install the application." UserInfo=0x7fe289c1a570 {NSLocalizedDescription=iOS Simulator failed to install the application., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
Any ideas?
Thanks
I installed ios-sim 1.5 via home brew. When I trying running ios-sim from the Terminal I get Segmentation fault: 11
I'm running OSX 10.7.4 on a Mac Mini. I have XCode 4.4 installed with the command line tools.
This is for Xcode 4.3 support. Let me know what I can do to help to facilitate this.
Can we get a git tag for release 1.3 (so GitHub creates a download for it?)
Can we have an option to specify an alternative to the /Developer path? This will be handy when you have multiple developer tools installed during beta periods.
I always get the following when running under Jenkins:
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 UserInfo=0x100270b90 "Simulator session timed out."
If I run the build manually from the workspace dir of jenkins it works. Any ideas?
With Xcode 4.4, there is no support for Snow Leopard (10.6 SDK). ios-sim hard-codes the SDK use in the .xcodeproj, but you can override this on the command-line in the Rakefile.
Fix:
In the Rakefile, we must dynamically get the base SDK and set it like so: https://github.com/apache/incubator-cordova-ios/blob/master/bin/templates/project/cordova/debug#L38
Latest everything, including having instaled both regular xcode and xcode5-DP3
I'm trying to brew install ios-sim
brew doctor reports "Warning: "config" scripts exist outside your system or Homebrew directories." but everything else is ok.
benjamin@nimas-i:~/Documents/code/abc$ brew install ios-sim
==> Downloading https://github.com/phonegap/ios-sim/archive/1.7.tar.gz
Already downloaded: /Library/Caches/Homebrew/ios-sim-1.7.tar.gz
==> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/rake install prefix=/usr/local/Ce
(4 failures)
rake aborted!
Command failed with status (65): [xcodebuild -project ios-sim.xcodeproj -con...]
/private/tmp/ios-sim-A3pf/ios-sim-1.7/Rakefile:7
(See full trace by running task with --trace)
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Is it possible to launch the OCUnit target app for a iOS Project?
I build the OCUnit test app with xcodebuild, but when i run the test app with
ios-sim launch build/path/App.app only the with screen opens and the tests are not launched.
Any ideas?
When specifying a specific device to launch with, an already running simulator will be used regardless of if that simulator's device is different than the specified device.
To reproduce (on ios-sim version 1.7):
ios-sim launch --family 'ipad' app/path
ios-sim launch --family 'iphone' app/path
The app will be launched inside the already running iPad simulator, instead of in an iPhone simulator. To workaround, you need to quit the simulator whenever you want to launch with a device type that isn't that of the currently running simulator.
See also: moredip/Sim-Launcher#20
I have troubles compiling the source (also using brew). It blocks during the compiling.
I'm using Xcode 4.6.3. Is there a place where I can download the binary ?
thanks
building with "Xcode 4.5" results in;
clang: error: no such file or directory: '4.5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks'
building with "Xcode4.5" builds as expected. (note the missing space)
Xcode 4.2
Phonegap 0.9.6
Followed the steps of the Phonegap Tutorial
http://www.phonegap.com/start#ios-x4
I get this:
sylvain-zimmers-macbook-pro-2:tedxparis sylvinus$ ios-sim launch ./ --verbose
[DEBUG] App Spec: <DTiPhoneSimulatorApplicationSpecifier 0x10021e310> specified by path /Users/sylvinus/w/joshfire/mytv/xcode/tedxparis
[DEBUG] SDK Root: <DTiPhoneSimulatorSystemRoot 0x10021cbb0> path=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk version=5.0 name=Simulator - iOS 5.0
[DEBUG] Creating named pipe at `/tmp/iphonesim-stderr-pipe-1311428558'
[DEBUG] Creating named pipe at `/tmp/iphonesim-stdout-pipe-1311428558'
[DEBUG] using device family iphone
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x103303e30 "Unknown error."
in console :
7/23/11 3:42:35 PM com.apple.launchd.peruser.501[274] (com.apple.iPhoneSimulator:com.apple.locationd[8106]) Exited with exit code: 1
7/23/11 3:42:38 PM com.apple.launchd.peruser.501[274] (com.apple.iPhoneSimulator:com.apple.dataaccess.dataaccessd) Unknown key for boolean: HighPriorityIO
7/23/11 3:42:38 PM com.apple.launchd.peruser.501[274] (com.apple.iPhoneSimulator:com.apple.marcoagent) Conflict with job: com.apple.marcoagent over Mach service: com.apple.marco
7/23/11 3:42:38 PM com.apple.launchd.peruser.501[274] (com.apple.iPhoneSimulator:com.apple.searchd) Unknown key for boolean: HighPriorityIO
7/23/11 3:42:39 PM vot[8147] ******** AX INSPECTOR MODE ************
7/23/11 3:42:39 PM com.apple.iPhoneSimulator:com.apple.locationd[8144] NOTICE,Location icon should now not be visible
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "Unknown error." UserInfo=0x102002aa0 {NSLocalizedDescription=Unknown error., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
After I spent 3 hours to make this project to run in 10.7 and Xcode 4.3.2, I got some error like above. Does anyone know about this?
I created an app to run with the sole purpose of crashing. I achieved this by calling NSAssert(NO,@"Force Crash") in the AppDelegate.
I then forked a copy of ios-sim and added my broken app as a launch argument.
I then set a breakpoint at line 82:iPhoneSimulator.m and in the lldb typed
po error
I then executed the lldb next command.
As you can see since the error is nil exit(EXIT_FAILURE); is never called, and hence exit(EXIT_SUCCESS) is called.
I also ran ios-sim through this process_events.py script and here were the results.
Source: http://www.opensource.apple.com/source/lldb/lldb-179.1/examples/python/process_events.py
#!/usr/bin/python
#----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
# On MacOSX csh, tcsh:
# setenv PYTHONPATH /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python
# On MacOSX sh, bash:
# export PYTHONPATH=/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python
#----------------------------------------------------------------------
import commands
import optparse
import os
import platform
import sys
#----------------------------------------------------------------------
# Code that auto imports LLDB
#----------------------------------------------------------------------
try:
# Just try for LLDB in case PYTHONPATH is already correctly setup
import lldb
except ImportError:
lldb_python_dirs = list()
# lldb is not in the PYTHONPATH, try some defaults for the current platform
platform_system = platform.system()
if platform_system == 'Darwin':
# On Darwin, try the currently selected Xcode directory
xcode_dir = commands.getoutput("xcode-select --print-path")
if xcode_dir:
lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
success = False
for lldb_python_dir in lldb_python_dirs:
if os.path.exists(lldb_python_dir):
if not (sys.path.__contains__(lldb_python_dir)):
sys.path.append(lldb_python_dir)
try:
import lldb
except ImportError:
pass
else:
print 'imported lldb from: "%s"' % (lldb_python_dir)
success = True
break
if not success:
print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"
sys.exit(1)
def print_threads(process, options):
if options.show_threads:
for thread in process:
print '%s %s' % (thread, thread.GetFrameAtIndex(0))
def run_commands(command_interpreter, commands):
return_obj = lldb.SBCommandReturnObject()
for command in commands:
command_interpreter.HandleCommand( command, return_obj )
if return_obj.Succeeded():
print return_obj.GetOutput()
else:
print return_obj
if options.stop_on_error:
break
def main(argv):
description='''Debugs a program using the LLDB python API and uses asynchronous broadcast events to watch for process state changes.'''
epilog='''Examples:
#----------------------------------------------------------------------
# Run "/bin/ls" with the arguments "-lAF /tmp/", and set a breakpoint
# at "malloc" and backtrace and read all registers each time we stop
#----------------------------------------------------------------------
% ./process_events.py --breakpoint malloc --stop-command bt --stop-command 'register read' -- /bin/ls -lAF /tmp/
'''
optparse.OptionParser.format_epilog = lambda self, formatter: self.epilog
parser = optparse.OptionParser(description=description, prog='process_events',usage='usage: process_events [options] program [arg1 arg2]', epilog=epilog)
parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help="Enable verbose logging.", default=False)
parser.add_option('-b', '--breakpoint', action='append', type='string', metavar='BPEXPR', dest='breakpoints', help='Breakpoint commands to create after the target has been created, the values will be sent to the "_regexp-break" command which supports breakpoints by name, file:line, and address.')
parser.add_option('-a', '--arch', type='string', dest='arch', help='The architecture to use when creating the debug target.', default=None)
parser.add_option('--platform', type='string', metavar='platform', dest='platform', help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".', default=None)
parser.add_option('-l', '--launch-command', action='append', type='string', metavar='CMD', dest='launch_commands', help='LLDB command interpreter commands to run once after the process has launched. This option can be specified more than once.', default=[])
parser.add_option('-s', '--stop-command', action='append', type='string', metavar='CMD', dest='stop_commands', help='LLDB command interpreter commands to run each time the process stops. This option can be specified more than once.', default=[])
parser.add_option('-c', '--crash-command', action='append', type='string', metavar='CMD', dest='crash_commands', help='LLDB command interpreter commands to run in case the process crashes. This option can be specified more than once.', default=[])
parser.add_option('-x', '--exit-command', action='append', type='string', metavar='CMD', dest='exit_commands', help='LLDB command interpreter commands to run once after the process has exited. This option can be specified more than once.', default=[])
parser.add_option('-T', '--no-threads', action='store_false', dest='show_threads', help="Don't show threads when process stops.", default=True)
parser.add_option('--ignore-errors', action='store_false', dest='stop_on_error', help="Don't stop executing LLDB commands if the command returns an error. This applies to all of the LLDB command interpreter commands that get run for launch, stop, crash and exit.", default=True)
parser.add_option('-n', '--run-count', type='int', dest='run_count', metavar='N', help='How many times to run the process in case the process exits.', default=1)
parser.add_option('-t', '--event-timeout', type='int', dest='event_timeout', metavar='SEC', help='Specify the timeout in seconds to wait for process state change events.', default=lldb.UINT32_MAX)
parser.add_option('-e', '--environment', action='append', type='string', metavar='ENV', dest='env_vars', help='Environment variables to set in the inferior process when launching a process.')
parser.add_option('-d', '--working-dir', type='string', metavar='DIR', dest='working_dir', help='The the current working directory when launching a process.', default=None)
parser.add_option('-p', '--attach-pid', type='int', dest='attach_pid', metavar='PID', help='Specify a process to attach to by process ID.', default=-1)
parser.add_option('-P', '--attach-name', type='string', dest='attach_name', metavar='PROCESSNAME', help='Specify a process to attach to by name.', default=None)
parser.add_option('-w', '--attach-wait', action='store_true', dest='attach_wait', help='Wait for the next process to launch when attaching to a process by name.', default=False)
try:
(options, args) = parser.parse_args(argv)
except:
return
attach_info = None
launch_info = None
exe = None
if args:
exe = args.pop(0)
launch_info = lldb.SBLaunchInfo (args)
if options.env_vars:
launch_info.SetEnvironmentEntries(options.env_vars, True)
if options.working_dir:
launch_info.SetWorkingDirectory(options.working_dir)
elif options.attach_pid != -1:
if options.run_count == 1:
attach_info = lldb.SBAttachInfo (options.attach_pid)
else:
print "error: --run-count can't be used with the --attach-pid option"
sys.exit(1)
elif not options.attach_name is None:
if options.run_count == 1:
attach_info = lldb.SBAttachInfo (options.attach_name, options.attach_wait)
else:
print "error: --run-count can't be used with the --attach-name option"
sys.exit(1)
else:
print 'error: a program path for a program to debug and its arguments are required'
sys.exit(1)
# Create a new debugger instance
debugger = lldb.SBDebugger.Create()
debugger.SetAsync (True)
command_interpreter = debugger.GetCommandInterpreter()
# Create a target from a file and arch
if exe:
print "Creating a target for '%s'" % exe
error = lldb.SBError()
target = debugger.CreateTarget (exe, options.arch, options.platform, True, error)
if target:
# Set any breakpoints that were specified in the args if we are launching. We use the
# command line command to take advantage of the shorthand breakpoint creation
if launch_info and options.breakpoints:
for bp in options.breakpoints:
debugger.HandleCommand( "_regexp-break %s" % (bp))
run_commands(command_interpreter, ['breakpoint list'])
for run_idx in range(options.run_count):
# Launch the process. Since we specified synchronous mode, we won't return
# from this function until we hit the breakpoint at main
error = lldb.SBError()
if launch_info:
if options.run_count == 1:
print 'Launching "%s"...' % (exe)
else:
print 'Launching "%s"... (launch %u of %u)' % (exe, run_idx + 1, options.run_count)
process = target.Launch (launch_info, error)
else:
if options.attach_pid != -1:
print 'Attaching to process %i...' % (options.attach_pid)
else:
if options.attach_wait:
print 'Waiting for next to process named "%s" to launch...' % (options.attach_name)
else:
print 'Attaching to existing process named "%s"...' % (options.attach_name)
process = target.Attach (attach_info, error)
# Make sure the launch went ok
if process and process.GetProcessID() != lldb.LLDB_INVALID_PROCESS_ID:
pid = process.GetProcessID()
listener = debugger.GetListener()
# sign up for process state change events
stop_idx = 0
done = False
while not done:
event = lldb.SBEvent()
if listener.WaitForEvent (options.event_timeout, event):
if lldb.SBProcess.EventIsProcessEvent(event):
state = lldb.SBProcess.GetStateFromEvent (event)
if state == lldb.eStateInvalid:
# Not a state event
print 'process event = %s' % (event)
else:
print "process state changed event: %s" % (lldb.SBDebugger.StateAsCString(state))
if state == lldb.eStateStopped:
if stop_idx == 0:
if launch_info:
print "process %u launched" % (pid)
run_commands(command_interpreter, ['breakpoint list'])
else:
print "attached to process %u" % (pid)
for m in target.modules:
print m
if options.breakpoints:
for bp in options.breakpoints:
debugger.HandleCommand( "_regexp-break %s" % (bp))
run_commands(command_interpreter, ['breakpoint list'])
run_commands (command_interpreter, options.launch_commands)
else:
if options.verbose:
print "process %u stopped" % (pid)
run_commands (command_interpreter, options.stop_commands)
stop_idx += 1
print_threads (process, options)
print "continuing process %u" % (pid)
process.Continue()
elif state == lldb.eStateExited:
exit_desc = process.GetExitDescription()
if exit_desc:
print "process %u exited with status %u: %s" % (pid, process.GetExitStatus (), exit_desc)
else:
print "process %u exited with status %u" % (pid, process.GetExitStatus ())
run_commands (command_interpreter, options.exit_commands)
done = True
elif state == lldb.eStateCrashed:
print "process %u crashed" % (pid)
print_threads (process, options)
run_commands (command_interpreter, options.crash_commands)
done = True
elif state == lldb.eStateDetached:
print "process %u detached" % (pid)
done = True
elif state == lldb.eStateRunning:
# process is running, don't say anything, we will always get one of these after resuming
if options.verbose:
print "process %u resumed" % (pid)
elif state == lldb.eStateUnloaded:
print "process %u unloaded, this shouldn't happen" % (pid)
done = True
elif state == lldb.eStateConnected:
print "process connected"
elif state == lldb.eStateAttaching:
print "process attaching"
elif state == lldb.eStateLaunching:
print "process launching"
else:
print 'event = %s' % (event)
else:
# timeout waiting for an event
print "no process event for %u seconds, killing the process..." % (options.event_timeout)
done = True
# Now that we are done dump the stdout and stderr
process_stdout = process.GetSTDOUT(1024)
if process_stdout:
print "Process STDOUT:\n%s" % (process_stdout)
while process_stdout:
process_stdout = process.GetSTDOUT(1024)
print process_stdout
process_stderr = process.GetSTDERR(1024)
if process_stderr:
print "Process STDERR:\n%s" % (process_stderr)
while process_stderr:
process_stderr = process.GetSTDERR(1024)
print process_stderr
process.Kill() # kill the process
else:
if error:
print error
else:
if launch_info:
print 'error: launch failed'
else:
print 'error: attach failed'
lldb.SBDebugger.Terminate()
if __name__ == '__main__':
main(sys.argv[1:])
When I run ios-sim start
from the command line, the simulator opens up with a black screen. I can fix this by clicking on the iOS Simulator menu item and running Reset Content and Settings. However, if I try rerunning ios-sim start
, I get the same thing.
Here's the verbose output:
➜ ios-sim start --verbose
[DEBUG] App Spec: (null)
[DEBUG] SDK Root: <DTiPhoneSimulatorSystemRoot 0x7fa850c1c040> path=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk version=6.1 name=Simulator - iOS 6.1
[DEBUG] Creating named pipe at `/var/folders/7c/p9pj8k5j5vgdlw7kynjpvr5m0000gn/T//ios-sim-stderr-pipe-1377305212'
[DEBUG] Creating named pipe at `/var/folders/7c/p9pj8k5j5vgdlw7kynjpvr5m0000gn/T//ios-sim-stdout-pipe-1377305212'
[DEBUG] using device family iphone
[DEBUG] Simulator started (no session)
If I try to run the simulator with an application, I get this:
➜ ios-sim launch release/ios.ipa --verbose
[DEBUG] App Spec: <DTiPhoneSimulatorApplicationSpecifier 0x7fdb5c000da0> specified by path /Users/landonschropp/Dropbox/Development/current/Edison/release/ios.ipa
[DEBUG] SDK Root: <DTiPhoneSimulatorSystemRoot 0x7fdb5c000910> path=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk version=6.1 name=Simulator - iOS 6.1
[DEBUG] Creating named pipe at `/var/folders/7c/p9pj8k5j5vgdlw7kynjpvr5m0000gn/T//ios-sim-stderr-pipe-1377305268'
[DEBUG] Creating named pipe at `/var/folders/7c/p9pj8k5j5vgdlw7kynjpvr5m0000gn/T//ios-sim-stdout-pipe-1377305268'
[DEBUG] using device family iphone
[DEBUG] Session could not be started: Error Domain==DTiPhoneSimulatorErrorDomain Code=1 "Unknown error." UserInfo=0x7fdb5c4162b0 {NSLocalizedDescription=Unknown error., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
sh:
ios-sim launch $(dirname $TEST_HOST) $environment_args --args -SenTest All $test_bundle_path
output:
[DEBUG] Test Suite 'All tests' started at 2013-05-10 03:51:23 +0000
Test Suite '/Users/zengming/lyleDev/meGits/baochuan/Build/Products/Debug-iphonesimulator/BCUnitTargetTests.octest(Tests)' started at 2013-05-10 03:51:23 +0000
Test Suite 'BCUnitTargetTests' started at 2013-05-10 03:51:23 +0000
[DEBUG] Test Case '-[BCUnitTargetTests testExample]' started.
Test Case '-[BCUnitTargetTests testExample]' passed (0.000 seconds).
Test Case '-[BCUnitTargetTests testExample2]' started.
Test Case '-[BCUnitTargetTests testExample2]' passed (0.000 seconds).
Test Case '-[BCUnitTargetTests testExample3]' started.
Assertion failed: (NO), function -[BCUnitTargetTests testExample3], file /Users/zengming/lyleDev/meGits/baochuan/Source/BCUnitTargetTests/BCUnitTargetTests.m, line 50.
Finished running tests with ios-sim
This All tests isn't finish. Lost testExample4, testExample5. None the Test Suite XXX finished
.
Because no the finished log
, that OCUnit2JUnit can't work to build junit report on Jenkins.
Please fix it.
When attempting to install my application on an iOS 7.0.3 simulator I'm finding that it's not working. The simulator opens, the app seems to be installed but when it tries to open the icons enlarges about halfway then fades out. See screenshot for it's last state before exiting.
The error I get on the command line is:
jm-imac:deskhop jm$ ios-sim launch ~/Downloads/testapp.app/
]Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7fef13f035c0 {NSLocalizedDescription=Simulator session timed out.}
What do you think about launching 'naked' emulator if ios-sim is invoked without options? And the help screen can be displayed using --help option.
Is there a way to actually do this using the current build? All I need it for is testing some mobile safari stuff, I managed to create a link to the iOS Simulator in Dock but it took a while, I was hoping ios-sim would be an easy shortcut for the app.
Hi,
ios-sim does not work for us on OS X 10.7. The problem is slightly different than the one described in the "jenkins" issue. When I run the launch command, simulator starts and the splash screen of our app flashes for a second. Then it returns to the homescreen causing ios-sim to report a "session timed out" error after a couple of seconds.
Running the same project in simulator from Xcode works.
Any advice would be greatly appreciated.
Best
Tim
I'm not sure what the threshold is, but it's greater than 300 characters. Whenever I get a single large log message, it blocks all further messages and appears to stall the app as well. These log messages come through just fine when running in Xcode.
after ver1.5.1, after the first open, select Hardware -> Device -> iphone (retina), the emulator window larger, and then repeatedly execute ios-sim, will become Hardware -> Device -> iphone, but the size of simulator unchanged
After i started a simulator with
ios-sim start --sdk 7.0 --tall --retina --exit
and closed it, when i run
ios-sim start --sdk 6.1 --exit
i see a 6.1, retina, 4 inches simulator instead of a 3.5 inches non-retina.
Only after closing it and relaunching again with the same command i see the expected simulator.
any idea?
When I try to install & run application with command
$ ios-sim launch project.app --exit
several times, after some attempts it starts to fail with following message
$ ios-sim launch ~/application.app --exit
Session could not be started:
Error Domain=DTiPhoneSimulatorErrorDomain Code=1
"iOS Simulator failed to install the application."
UserInfo=0x7fe932013ab0
{NSLocalizedDescription=iOS Simulator failed to install the application.,
DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
Temporary solution is to reset simulator but after several attempts, the problem is back. This wasn't happening with Xcode 4.X and iOS6.1
MacOS 10.8.5
Xcode 5
iOS Simulator - iOS7
ios-sim v. 1.8.2
Now what ? How do I run the app ?
using HEAD incubator-cordova-ios create
, build
and then emulate
I get the following output and error:
https://gist.github.com/3352699
dyld: Symbol not found: _OBJC_CLASS_$_NSObject
Referenced from: /usr/local/bin/ios-sim
Expected in: /usr/lib/libobjc.A.dylib
in /usr/local/bin/ios-sim
running 10.7.4 and xcode Xcode45-DP1
if I install from git (via rake install prefix=/usr/local/
) I get absolutely no output or new processes when I run ./cordova/emulate
:
pizzacats:cordova-test maxogden$ ./cordova/emulate
pizzacats:cordova-test maxogden$
additionally I can't figure out how to make cordova's ./debug
and ./emulate
commands use a different XCode than 45-DP1 (I have other XCodes on my machine), maybe its an environment variable?
If you use the --debug option, the debugger replaces the ios-sim process, so there is nothing reading from the fifos and forwarding them to the terminal. This will eventually hang when the fifo buffer fills up. I think all you need to do to fix this is fork before executing the debugger.
If I install same application second time with additional resources in it then the new resources are merged in the resulting app file.
I dont want to merge but overwrite the resources.
Is there any arguments that I can specify in setSimulatedApplicationLaunchArgs or other methods , which would allow me to do so?
Or is there any provision in "iPhoneSimulatorRemoteClient" framework?
Thanks in advance.
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
** BUILD FAILED **
The following build commands failed:
ios-sim:
Ld /Volumes/MacintoshHD/Users/christian/src/ios-sim/build/ios-sim.build/Release/ios-sim.build/Objects-normal/i386/ios-sim normal i386
Ld /Volumes/MacintoshHD/Users/christian/src/ios-sim/build/ios-sim.build/Release/ios-sim.build/Objects-normal/x86_64/ios-sim normal x86_64
(2 failures)
rake aborted!
Command failed with status (1): [xcodebuild -project ios-sim.xcodeproj -con...]
I compiled a binary file,to other people.it have as follow errors.
How to solve it?
dyld: Library not loaded: rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
Referenced from: /Users/honghui/Downloads/Release/ios-sim
Reason: image not found
Trace/BPT trap: 5
need to escape in
int nsprintf (NSString *format, ...)
Stacktrace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.CoreFoundation 0x00007fff8a460917 CFStringAppendFormatCore + 9495
1 com.apple.CoreFoundation 0x00007fff8a45e229 CFStringCreateWithFormatAndArguments + 105
2 ios-sim 0x00000001000037b1 nsvfprintf + 49
3 ios-sim 0x0000000100003b45 nsprintf + 373
4 ios-sim 0x0000000100001ecc -[iPhoneSimulator stdioDataIsAvailable:] + 364
5 com.apple.Foundation 0x00007fff8aab9d32 __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 47
6 com.apple.CoreFoundation 0x00007fff8a4a6aaa _CFXNotificationPost + 2634
7 com.apple.Foundation 0x00007fff8aaa5fe7 -[NSNotificationCenter postNotificationName:object:userInfo:] + 65
8 com.apple.Foundation 0x00007fff8ab726c1 _performFileHandleSource + 1129
9 com.apple.CoreFoundation 0x00007fff8a46c6e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
10 com.apple.CoreFoundation 0x00007fff8a46bf4d __CFRunLoopDoSources0 + 253
11 com.apple.CoreFoundation 0x00007fff8a492d39 __CFRunLoopRun + 905
12 com.apple.CoreFoundation 0x00007fff8a492676 CFRunLoopRunSpecific + 230
13 com.apple.Foundation 0x00007fff8aaaef9f -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 267
14 com.apple.Foundation 0x00007fff8aaaee8b -[NSRunLoop(NSRunLoop) run] + 62
15 ios-sim 0x0000000100003760 main + 192
16 ios-sim 0x0000000100001694 start + 52
As ios-sim is now also an npm published package, why the npm installation is not actually documented?
I need this to automate capturing of screenshots at iPhone 5 aspect ratio, which are now required for App Store submission. It seems there may be a value that could be passed to [DTiPhoneSimulatorSessionConfig setSimulatedDeviceFamily] that would achieve this. I don't know that number would be however, as this "DTiPhoneSimulator..." SDK seems to be undocumented. Existing code seems to only use 1 for iPhone or 2 for iPad, and I haven't had any luck changing this to 3 or 4. I know the iOS simulator supports iPhone 5, however, as hardware "iPhone (Retina 4-inch)", so this should be possible.
Thanks.
See https://github.com/jhaynie/iphonesim/issues#issue/3 for more info.
Is there a way to launch the simulator in Retina mode? I see and have tested the iPad option but based on what I see in the source, don't see the same for retina.
Hello,
We are getting an intermittent issue where our unit tests pass, but ios-sim returns an error code of 1. Has anyone encountered this issue before?
$ ios-sim
dyld: Library not loaded: @rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
Reason: image not found
Trace/BPT trap: 5
$
This is a similar error as #21, #15 and others, but I have tried to reset my computer, and I am running from within a vanilla terminal.
But I do seem to be running newer versions of things than others: osx 10.8, xcode 4.6. This is for iOS 6.1, but it doesn't matter what version SDK I give ios-sim. I have not tried downgrading for anything yet.
Error:
[DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x100508820 {NSLocalizedDescription=Simulator session timed out.}
thanx
should be prefix=/usr/local/ not prefix=/usr/local/bin/
(will install prefix=/usr/local/bin/bin/ios-sim)
$ brew install ios-sim
==> Downloading https://github.com/Fingertips/ios-sim/tarball/1.3
File already downloaded in /Users/pain/Library/Caches/Homebrew
==> rake install prefix='/usr/local/Cellar/ios-sim/1.3'
xcodebuild -project ios-sim.xcodeproj -configuration Release SYMROOT=build
Build settings from command line:
SYMROOT = build
=== BUILD NATIVE TARGET ios-sim OF PROJECT ios-sim WITH CONFIGURATION Release ===
Check dependencies
ProcessPCH /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.pth ios-sim_Prefix.pch normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a
setenv LANG en_US.US-ASCII
/usr/bin/clang -x objective-c-header -arch i386 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion "-DIBOutlet=attribute((iboutlet))" "-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))" "-DIBAction=void)attribute((ibaction)" -iquote /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-generated-files.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-own-target-headers.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-all-target-headers.hmap -iquote /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-project-headers.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/Release/include -I. -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/DerivedSources/i386 -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/DerivedSources -F/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/Release -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks --serialize-diagnostics /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.dia -c /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/ios-sim_Prefix.pch -o /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.d
clang: error: unsupported option '--serialize-diagnostics'
clang: error: no such file or directory: '/var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.dia'
Command /usr/bin/clang failed with exit code 1
ProcessPCH /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.pth ios-sim_Prefix.pch normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a
setenv LANG en_US.US-ASCII
/usr/bin/clang -x objective-c-header -arch x86_64 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -fasm-blocks -Wprotocol -Wdeprecated-declarations -mmacosx-version-min=10.6 -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion "-DIBOutlet=attribute((iboutlet))" "-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))" "-DIBAction=void)attribute((ibaction)" -iquote /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-generated-files.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-own-target-headers.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-all-target-headers.hmap -iquote /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/ios-sim-project-headers.hmap -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/Release/include -I. -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/DerivedSources/x86_64 -I/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/ios-sim.build/Release/ios-sim.build/DerivedSources -F/tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/build/Release -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks --serialize-diagnostics /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.dia -c /tmp/homebrew-ios-sim-1.3-kj5x/Fingertips-ios-sim-b08620a/ios-sim_Prefix.pch -o /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.d
clang: error: unsupported option '--serialize-diagnostics'
clang: error: no such file or directory: '/var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.dia'
Command /usr/bin/clang failed with exit code 1
** BUILD FAILED **
The following build commands failed:
ProcessPCH /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-aycxupkqsvcnczaelyigcuxftdov/ios-sim_Prefix.pch.pth ios-sim_Prefix.pch normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
ProcessPCH /var/folders/vl/0dd_5681229cwgjbq8345lxm0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/ios-sim_Prefix-bgiswialvdheeicxqwemwuojpaje/ios-sim_Prefix.pch.pth ios-sim_Prefix.pch normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
rake aborted!
Command failed with status (65): [xcodebuild -project ios-sim.xcodeproj -con...]
Tasks: TOP => install => build
(See full trace by running task with --trace)
==> Exit Status: 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/ios-sim.rb#L9
==> Environment
HOMEBREW_VERSION: 0.8.1
HEAD: f6b14a6ab9108c3e8aaab2bdce542653dce5c10d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.0 build 211
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /Users/pain/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
==> Build Flags
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4
Error: Failed executing: rake install prefix='/usr/local/Cellar/ios-sim/1.3'
If `brew doctor' does not help diagnose the issue, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
$ brew doctor
Your system is raring to brew.
Due to working on other projects, I can’t give this tool the attention it deserves atm. If you use it on daily basis, please consider taking over maintenance.
I'm hoping it's just me being stupid... but I can't simulate a3.5-inch retina device.
Example:
ios-sim launch build/MyLovelyApp.app --retina
This will simulate the "iPhone Retina (4-inch)" device, even though I didn't specify "--tall". When it's running, I can successfully switch to the 3.5-inch retina mode.
Does anyone else see the same?
Thanks for reading :-)
or else the app is tied to the version of xcode you compiled it with
you should be getting this from DEVELOPER_DIR environment variable or xcode-select -print-path
lei:ios-sim firede$ rake install prefix=/usr/local/
xcodebuild -project ios-sim.xcodeproj -configuration Release SYMROOT=build
Build settings from command line:
SYMROOT = build
=== BUILD NATIVE TARGET ios-sim OF PROJECT ios-sim WITH CONFIGURATION Release ===
Check dependencies
error: There is no SDK with the name or path '/Users/firede/workspace/ios-sim/ios-sim/macosx10.6'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
rake aborted!
Command failed with status (65): [xcodebuild -project ios-sim.xcodeproj -con...]
Tasks: TOP => install => build
(See full trace by running task with --trace)
Env:
os x 10.8
xcode 4.4
ruby 1.9.3p194
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.