Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed -it flag and added parameter for starting the simulator detached #45

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ function error {

function usage {
echo "usage: $0 [-h|--help] [-d|--debug] [-m|--model (nanos*|nanox|nanosplus)] [-l|--load] [-s|--speculos] [-c|--cxlib 1.0.2]"
echo "-d|--debug: build app with DEBUG=1"
echo "-m|--model: nanos (default), nanox, nanosplus"
echo "-l|--load: load app to device"
echo "-p|--pull: force pull docker images before using them"
echo "-s|--speculos: run app after building with the speculos simulator"
echo "-c|--cxlib: don't autodetect cx-lib version (for speculos)"
echo "-g|--gdb: start speculos with -d (waiting for gdb debugger)"
echo "-a|--analyze run static code analysis"
echo "-v|--variant build for 'iota' or 'shimmer'"
echo "-d|--debug: build app with DEBUG=1"
echo "-b|--background: start simulator in background (detached)"
echo "-m|--model: nanos (default), nanox, nanosplus"
echo "-l|--load: load app to device"
echo "-p|--pull: force pull docker images before using them"
echo "-s|--speculos: run app after building with the speculos simulator"
echo "-c|--cxlib: don't autodetect cx-lib version (for speculos)"
echo "-g|--gdb: start speculos with -d (waiting for gdb debugger)"
echo "-a|--analyze run static code analysis"
echo "-v|--variant build for 'iota' or 'shimmer'"
exit 1
}

Expand Down Expand Up @@ -77,6 +78,7 @@ load=0
speculos=0
debug=0
gdb=0
background=0
analysis=0
pull=0
cxlib=""
Expand Down Expand Up @@ -104,6 +106,9 @@ do
"-d" | "--debug")
debug=1
;;
"-b" | "--background")
background=1
;;
"-g" | "--gdb")
gdb=1
;;
Expand Down Expand Up @@ -219,14 +224,16 @@ docker run \

(( $gdb )) && extra_args="-d "

(( $background )) && docker_extra_args="-d "

docker run \
-v "$rpath:/speculos/apps" \
-p 9999:9999 \
-p 5000:5000 \
-p 1234:1234 \
-e SPECULOS_APPNAME="$APPNAME:$APPVERSION" \
$docker_extra_args \
--rm \
-it \
speculos \
--apdu-port 9999 \
--display headless \
Expand Down