-
Notifications
You must be signed in to change notification settings - Fork 0
/
android
executable file
·28 lines (22 loc) · 928 Bytes
/
android
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
DEVICE_IP="192.168.0.98"
PACKAGE_NAME="com.sadjockerking.robolve"
robolve_root=$(xdg-user-dir DOCUMENTS)
sh Extras/copyfiles.sh
cd $robolve_root/projects/Robolve/
# Chech if there are devices connected, if not connect to the default ip, if not exit
adb devices | grep "device$" ||
adb connect $DEVICE_IP | grep "connected" ||
{ echo "There is no device to run the app"; exit; }
# Turn on screen for feedback purposes
adb shell dumpsys power | grep 'mHoldingDisplaySuspendBlocker=false' &&
adb shell input keyevent 26 &&
adb shell input keyevent 82
# Compile and run project
cocos run -p android && echo "Success"
[ $? -ne 0 ] && echo "Failure" && exit
# Try to turn it on again just in case
adb shell dumpsys power | grep 'mHoldingDisplaySuspendBlocker=false' &&
adb shell input keyevent 26 &&
adb shell input keyevent 82
# Use pidcat (an improved logcat) for showing debug messages from this project
pidcat $PACKAGE_NAME